From: Guido van Rossum Date: Wed, 14 Jan 1998 15:40:30 +0000 (+0000) Subject: Seems I've found a way to fix this. X-Git-Tag: v1.5.1~957 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8687164426da64ec03762c0e73daac91fba17927;p=python Seems I've found a way to fix this. --- diff --git a/Lib/code.py b/Lib/code.py index e01051e288..9b40ed97b9 100644 --- a/Lib/code.py +++ b/Lib/code.py @@ -1,5 +1,3 @@ -# XXX This is broken with class exceptions - """Utilities dealing with code objects.""" def compile_command(source, filename="", symbol="single"): @@ -50,7 +48,15 @@ def compile_command(source, filename="", symbol="single"): if code: return code - if not code1 and err1 == err2: + try: + e1 = err1.__dict__ + except AttributeError: + e1 = err1 + try: + e2 = err2.__dict__ + except AttributeError: + e2 = err2 + if not code1 and e1 == e2: raise SyntaxError, err1