New issue
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
py2_test_grammar.py contains invalid syntax for 2.6 #52488
Comments
Lib\lib2to3\tests\data\py2_test_grammar.py, in test_with_statement, requires a variant of the with statement (multiple targets) that is not available in Python 2.6. Compiling py2_test_grammar.py raises a SyntaxError. This makes the 2.6.5 installer exit with an error message when asked to pre-compile all .pyc files, as reported in bpo-6716. The fix is simply to remove the last three 'with' statements in function test_with_statement, around line 923 in Lib\lib2to3\tests\data\py2_test_grammar.py, as this is invalid code for this Python version. |
The correct thing to do is actually to ignore py2_test_grammar.py when compiling the pyc files. |
I have upload a patch for this problem by just removing the lines as Gabriel said. Please check it out. Thanks. |
Benjamin, ISTM that the tests in lib2to3/tests/data/py2_test_grammar aren't run at all, as part of regrtest. If so, the entire file could be removed. |
2010/4/11 Martin v. Löwis <report@bugs.python.org>:
True, but then it would become out of sync with the other branches. |
I have now fixed this with r83721, by excluding the file from compileall. |
with statement
syntax invalid problem in py2_test_grammar.pyNote: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: