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:10:28 +02:00
parent a97c57c8fd
commit 45c4375ea7
4 changed files with 29 additions and 2 deletions

View file

@ -1436,7 +1436,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