Author: Maciej Fijalkowski <[email protected]>
Branch: kill-someobject
Changeset: r58038:5c41421dec55
Date: 2012-10-12 15:32 +0200
http://bitbucket.org/pypy/pypy/changeset/5c41421dec55/
Log: merge
diff --git a/pypy/rpython/llinterp.py b/pypy/rpython/llinterp.py
--- a/pypy/rpython/llinterp.py
+++ b/pypy/rpython/llinterp.py
@@ -145,8 +145,12 @@
assert isinstance(exc, LLException)
klass, inst = exc.args[0], exc.args[1]
for cls in enumerate_exceptions_top_down():
- if "".join(klass.name).rstrip("\0") == cls.__name__:
- return cls
+ if hasattr(klass, 'name'): # lltype
+ if "".join(klass.name).rstrip("\0") == cls.__name__:
+ return cls
+ else: # ootype
+ if klass._INSTANCE._name.split('.')[-1] == cls.__name__:
+ return cls
raise ValueError("couldn't match exception, maybe it"
" has RPython attributes like OSError?")
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit