mirror of
https://github.com/python/cpython
synced 2024-09-22 07:41:37 +00:00
#7842: backport fix for py_compile.compile syntax error message handling.
This commit is contained in:
parent
5aff27aec1
commit
c32b678fd0
|
@ -112,7 +112,7 @@ def compile(file, cfile=None, dfile=None, doraise=False):
|
|||
try:
|
||||
codeobject = __builtin__.compile(codestring, dfile or file,'exec')
|
||||
except Exception,err:
|
||||
py_exc = PyCompileError(err.__class__,err.args,dfile or file)
|
||||
py_exc = PyCompileError(err.__class__, err, dfile or file)
|
||||
if doraise:
|
||||
raise py_exc
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue