Mercurial > cpython-lru_cache-weakref
diff Lib/code.py @ 7097:00a85ab0337f legacy-trunk
Seems I've found a way to fix this.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 14 Jan 1998 15:40:30 +0000 |
| parents | 644484e1a37b |
| children | fb4b4d069cc7 |
line wrap: on
line diff
--- a/Lib/code.py Wed Jan 14 14:51:31 1998 +0000 +++ b/Lib/code.py Wed Jan 14 15:40:30 1998 +0000 @@ -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 @@ 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
