diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2003-01-15 11:51:06 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2003-01-15 11:51:06 (GMT) |
commit | 0c6774d92b48c4c4097a3a3bea2294093092e4e3 (patch) | |
tree | 99fca658cecaee2a9ec1d8bff51357bc8e61c504 /Lib/zipfile.py | |
parent | d69663d3009b6718ed3fa27dec800d15c7d4babb (diff) | |
download | cpython-0c6774d92b48c4c4097a3a3bea2294093092e4e3.zip cpython-0c6774d92b48c4c4097a3a3bea2294093092e4e3.tar.gz cpython-0c6774d92b48c4c4097a3a3bea2294093092e4e3.tar.bz2 |
Patch #661719: Expose compilation errors as exceptions on request.
Diffstat (limited to 'Lib/zipfile.py')
-rw-r--r-- | Lib/zipfile.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 6aed172..80d7925 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -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 |