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:
XinlongCS
2025-12-18 15:38:03 -06:00
parent 3d4ffc3911
commit a4c113ec31
@@ -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)