We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug report
ast.parse() uses the assert statement to validate the feature_version argument:
ast.parse()
feature_version
$ python3 -c 'import ast; ast.parse("print", feature_version=(2, 7))' Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/jwilk/.local/lib/python3.11/ast.py", line 45, in parse assert major == 3 AssertionError
This is bad because the check will go away if you enable optimizations:
$ python3 -O -c 'import ast; ast.parse("print", feature_version=(2, 7))' && echo yay yay
Your environment
Python 3.11.0b4
The text was updated successfully, but these errors were encountered:
pythongh-95066: ast: Replace AssertionError with ValueError
b09028d
gh-95066: ast: Replace assert with ValueError (GH-95072)
a5dde0f
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Fixed with #95072. Thanks for the report, @jwilk! ✨ 🍰 ✨
Sorry, something went wrong.
No branches or pull requests
Bug report
ast.parse()
uses the assert statement to validate thefeature_version
argument:This is bad because the check will go away if you enable optimizations:
Your environment
Python 3.11.0b4
The text was updated successfully, but these errors were encountered: