Author: Lukas Diekmann <[email protected]>
Branch: type-specialized-instances
Changeset: r49634:1ff52ab49127
Date: 2011-11-21 17:34 +0100
http://bitbucket.org/pypy/pypy/changeset/1ff52ab49127/

Log:    fallback to PlainAttribute on AttributeError. this fix is needed for
        modules, since they do not have a typedef

diff --git a/pypy/objspace/std/mapdict.py b/pypy/objspace/std/mapdict.py
--- a/pypy/objspace/std/mapdict.py
+++ b/pypy/objspace/std/mapdict.py
@@ -356,9 +356,13 @@
         obj._mapdict_write_storage(self.position, erased)
 
 def get_attrclass_from_value(space, w_value):
-    if space.is_w(space.type(w_value), space.w_int):
-        return IntAttribute
-    return PlainAttribute
+    attrclass = PlainAttribute
+    try:
+        if space.is_w(space.type(w_value), space.w_int):
+            attrclass = IntAttribute
+    except AttributeError:
+        pass
+    return attrclass
 
 def _become(w_obj, new_obj):
     # this is like the _become method, really, but we cannot use that due to
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to