mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Seems I've found a way to fix this.
This commit is contained in:
parent
af8a015c93
commit
8687164426
1 changed files with 9 additions and 3 deletions
12
Lib/code.py
12
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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue