Skip to content

refactor(parser): Remove deprecated ast.Str fallback for Python 3.8+ compatibility - #696

Open
ivegotahunnitonit wants to merge 1 commit into
google:masterfrom
ivegotahunnitonit:modernize-ast-str-cleanup
Open

refactor(parser): Remove deprecated ast.Str fallback for Python 3.8+ compatibility#696
ivegotahunnitonit wants to merge 1 commit into
google:masterfrom
ivegotahunnitonit:modernize-ast-str-cleanup

Conversation

@ivegotahunnitonit

Copy link
Copy Markdown

Description

In fire/parser.py, _StrNode maintained a legacy conditional check for Python < 3.8 (ast.Str). In modern Python versions (3.8 through 3.14+), string literals in the standard library ast module are uniformly represented as ast.Constant with a string value.

This PR modernizes _StrNode to check isinstance(node, ast.Constant) and isinstance(node.value, str), eliminating deprecation warnings and unnecessary pylint suppressions while ensuring clean forward compatibility.

Verification Output

$ python -m pytest fire/parser_test.py
48 passed in 0.14s (100% pass, 0 failures)

@google-cla

google-cla Bot commented Aug 20, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@ivegotahunnitonit

Copy link
Copy Markdown
Author

@googlebot I signed it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant