Skip to content

Commit

Permalink
refactor: 3.8+ always has ast.Constant, no need for ast.Str
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed May 5, 2024
1 parent ba3f166 commit 4f6fbac
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/scriv/literals.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,9 @@ def check_value(self, value):
If it is, save the string value as `self.value`.
"""
ast_Constant = getattr(ast, "Constant", None)
if ast_Constant and isinstance(value, ast_Constant):
if isinstance(value, ast.Constant):
if isinstance(value.value, str):
self.value = value.value
elif isinstance(value, ast.Str):
self.value = value.s


def find_nested_value(
Expand Down

0 comments on commit 4f6fbac

Please sign in to comment.