]> granicus.if.org Git - python/commitdiff
Seems I've found a way to fix this.
authorGuido van Rossum <guido@python.org>
Wed, 14 Jan 1998 15:40:30 +0000 (15:40 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 14 Jan 1998 15:40:30 +0000 (15:40 +0000)
Lib/code.py

index e01051e2889c4925dc449377278c14cbf527afd6..9b40ed97b9641766dc6e3afdb9cf567c09a35a5b 100644 (file)
@@ -1,5 +1,3 @@
-# XXX This is broken with class exceptions
-
 """Utilities dealing with code objects."""
 
 def compile_command(source, filename="<input>", symbol="single"):
@@ -50,7 +48,15 @@ def compile_command(source, filename="<input>", 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