mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Patch #661719: Expose compilation errors as exceptions on request.
This commit is contained in:
parent
d69663d300
commit
0c6774d92b
5 changed files with 92 additions and 28 deletions
|
@ -604,7 +604,10 @@ class PyZipFile(ZipFile):
|
|||
import py_compile
|
||||
if self.debug:
|
||||
print "Compiling", file_py
|
||||
py_compile.compile(file_py, file_pyc)
|
||||
try:
|
||||
py_compile.compile(file_py, file_pyc, None, True)
|
||||
except py_compile.PyCompileError,err:
|
||||
print err.msg
|
||||
fname = file_pyc
|
||||
else:
|
||||
fname = file_pyc
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue