Skip to content

Commit

Permalink
Fix munging of __version__
Browse files Browse the repository at this point in the history
  • Loading branch information
jepler committed Jan 11, 2024
1 parent 1fa9182 commit ce6de42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion circuitpython_build_tools/munge.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def process_statement(node):
# return the statements in the else branch of 'if TYPE_CHECKING: ...'
elif ast.unparse(node.test) == 'TYPE_CHECKING':
replace(node.lineno, 'if 0:')
elif isinstance(node, ast.Assign) and node.targets[0].id == '__version__':
elif isinstance(node, ast.Assign) and isinstance(node.targets[0], ast.Name) and node.targets[0].id == '__version__':
replace(node.lineno, f"__version__ = \"{version_str}\"")

content = pathlib.Path(path).read_text(encoding="utf-8")
Expand Down

0 comments on commit ce6de42

Please sign in to comment.