Skip to content

Commit b64ad17

Browse files
authored
Remove deprecated and to be removed (in 3.14) old Ast classes (#91)
1 parent 76addf5 commit b64ad17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docstring_parser/attrdoc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def ast_unparse(node: ast.AST) -> T.Optional[str]:
3434
if hasattr(ast, "unparse"):
3535
return ast.unparse(node)
3636
# Support simple cases in Python < 3.9
37-
if isinstance(node, (ast.Str, ast.Num, ast.NameConstant, ast.Constant)):
37+
if isinstance(node, (ast.Constant)):
3838
return str(ast_get_constant_value(node))
3939
if isinstance(node, ast.Name):
4040
return node.id
@@ -45,7 +45,7 @@ def ast_is_literal_str(node: ast.AST) -> bool:
4545
"""Return True if the given node is a literal string."""
4646
return (
4747
isinstance(node, ast.Expr)
48-
and isinstance(node.value, (ast.Constant, ast.Str))
48+
and isinstance(node.value, (ast.Constant))
4949
and isinstance(ast_get_constant_value(node.value), str)
5050
)
5151

0 commit comments

Comments
 (0)