]> granicus.if.org Git - python/commitdiff
#7842: backport fix for py_compile.compile syntax error message handling.
authorR David Murray <rdmurray@bitdance.com>
Wed, 20 Feb 2013 01:00:11 +0000 (20:00 -0500)
committerR David Murray <rdmurray@bitdance.com>
Wed, 20 Feb 2013 01:00:11 +0000 (20:00 -0500)
Lib/py_compile.py
Misc/NEWS

index dc1cae98dd928e4c9c7d95f0325342b00597512b..c0bc1e4eb825c89867ce8ae729faa1d5b5cf6e35 100644 (file)
@@ -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:
index 79e350a497e91a0ffd38cc2665e2fc4e4fabc72d..d03d7c638ae92ccae8e8d1fc8b7e282257d9cd20 100644 (file)
--- 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.