Issue #12004: Fix an internal error in PyZipFile when writing an invalid

Python file.  Patch by Ben Morgan.
This commit is contained in:
Serhiy Storchaka 2013-01-29 20:15:45 +02:00
commit f7209225bb
4 changed files with 30 additions and 2 deletions

View file

@ -1604,7 +1604,7 @@ class PyZipFile(ZipFile):
print("Compiling", file)
try:
py_compile.compile(file, doraise=True, optimize=optimize)
except py_compile.PyCompileError as error:
except py_compile.PyCompileError as err:
print(err.msg)
return False
return True