From: R David Murray Date: Wed, 20 Feb 2013 01:00:11 +0000 (-0500) Subject: #7842: backport fix for py_compile.compile syntax error message handling. X-Git-Tag: v2.7.4rc1~100 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c32b678fd057f10ef1bf8999b7785f51e0e5f81b;p=python #7842: backport fix for py_compile.compile syntax error message handling. --- diff --git a/Lib/py_compile.py b/Lib/py_compile.py index dc1cae98dd..c0bc1e4eb8 100644 --- a/Lib/py_compile.py +++ b/Lib/py_compile.py @@ -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: diff --git a/Misc/NEWS b/Misc/NEWS index 79e350a497..d03d7c638a 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -208,6 +208,8 @@ Core and Builtins Library ------- +- Issue #7842: backported fix for py_compile.compile() syntax error handling. + - Issue #13153: Tkinter functions now raise TclError instead of ValueError when a unicode argument contains non-BMP character.