[pypy-commit] pypy kill-someobject: ootype fix
arigo
noreply at buildbot.pypy.org
Fri Oct 12 15:30:45 CEST 2012
Author: Armin Rigo <arigo at tunes.org>
Branch: kill-someobject
Changeset: r58030:a0a3d5a831b2
Date: 2012-10-12 15:30 +0200
http://bitbucket.org/pypy/pypy/changeset/a0a3d5a831b2/
Log: ootype fix
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?")
More information about the pypy-commit
mailing list