Commits

Lukas Diekmann committed 1ff52ab

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

  • Participants
  • Parent commits 9034818
  • Branches type-specialized-instances

Comments (0)

Files changed (1)

File pypy/objspace/std/mapdict.py

         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