summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-01-14 15:40:30 (GMT)
committerGuido van Rossum <guido@python.org>1998-01-14 15:40:30 (GMT)
commit8687164426da64ec03762c0e73daac91fba17927 (patch)
treed345fe764f3086ab050bdbbf63e101dec37b5178 /Lib
parentaf8a015c937d11e4efcda3f91344ad3e758d26e8 (diff)
downloadcpython-8687164426da64ec03762c0e73daac91fba17927.zip
cpython-8687164426da64ec03762c0e73daac91fba17927.tar.gz
cpython-8687164426da64ec03762c0e73daac91fba17927.tar.bz2
Seems I've found a way to fix this.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/code.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/Lib/code.py b/Lib/code.py
index e01051e..9b40ed9 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="<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