mirror of
https://github.com/syssec-utd/pylingual.git
synced 2026-05-11 02:40:13 -07:00
Ast fix for old deprecated values
Fixes AttributeError: module 'ast' has no attribute 'Str' Co-Authored-By: jdw170000 <50096766+jdw170000@users.noreply.github.com>
This commit is contained in:
@@ -35,8 +35,8 @@ def normalize_source(
|
||||
tree = ast.parse(source, feature_version=version)
|
||||
if replace_docstrings:
|
||||
for node in ast.walk(tree):
|
||||
if isinstance(node, ast.Expr) and isinstance(node.value, ast.Str):
|
||||
node.value.s = "pass"
|
||||
if isinstance(node, ast.Expr) and isinstance(node.value, ast.Constant) and isinstance(node.value.value, str):
|
||||
node.value.value = "pass"
|
||||
return ast.unparse(tree)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user