mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Fix compileall.py so that it fails on SyntaxErrors
The changes cause compilation failures in any file in the Python installation lib directory to cause the install to fail. It looks like compileall.py intended to behave this way, but a change to py_compile.py and a separate bug defeated it. Fixes SF bug #412436 This change affects the test suite, which contains several files that contain intentional errors. The solution is to extend compileall.py with the ability to skip compilation of selected files. In the test suite, rename nocaret.py and test_future[3..7].py to start with badsyntax_nocaret.py and badsyntax_future[3..7].py. Update the makefile to skip compilation of these files. Update the tests to use the name names for imports. NB compileall.py is changed so that compile_dir() returns success only if all recursive calls to compile_dir() also check success.
This commit is contained in:
parent
bc41957d2b
commit
3090694068
10 changed files with 11 additions and 16 deletions
10
Lib/test/badsyntax_future6.py
Normal file
10
Lib/test/badsyntax_future6.py
Normal file
|
@ -0,0 +1,10 @@
|
|||
"""This is a test"""
|
||||
"this isn't a doc string"
|
||||
from __future__ import nested_scopes
|
||||
|
||||
def f(x):
|
||||
def g(y):
|
||||
return x + y
|
||||
return g
|
||||
|
||||
print f(2)(4)
|
Loading…
Add table
Add a link
Reference in a new issue