[Python-checkins] r46283 - python/branches/sreifschneider-newnewexcept/Lib/codeop.py
sean.reifschneider
python-checkins at python.org
Fri May 26 12:37:01 CEST 2006
Author: sean.reifschneider
Date: Fri May 26 12:37:01 2006
New Revision: 46283
Modified:
python/branches/sreifschneider-newnewexcept/Lib/codeop.py
Log:
Changing the exception comparison to use repr, they no longer have __dict__.
Modified: python/branches/sreifschneider-newnewexcept/Lib/codeop.py
==============================================================================
--- python/branches/sreifschneider-newnewexcept/Lib/codeop.py (original)
+++ python/branches/sreifschneider-newnewexcept/Lib/codeop.py Fri May 26 12:37:01 2006
@@ -95,15 +95,7 @@
if code:
return code
- try:
- e1 = err1.__dict__
- except AttributeError:
- e1 = err1
- try:
- e2 = err2.__dict__
- except AttributeError:
- e2 = err2
- if not code1 and e1 == e2:
+ if not code1 and repr(err1) == repr(err2):
raise SyntaxError, err1
def _compile(source, filename, symbol):
More information about the Python-checkins
mailing list