[pypy-commit] pypy type-specialized-instances: fixed read with new selector (still not sure if this is the right fix)

l.diekmann noreply at buildbot.pypy.org
Fri Nov 18 14:42:31 CET 2011


Author: Lukas Diekmann <lukas.diekmann at uni-duesseldorf.de>
Branch: type-specialized-instances
Changeset: r49525:ca3e806187f6
Date: 2011-11-18 14:41 +0100
http://bitbucket.org/pypy/pypy/changeset/ca3e806187f6/

Log:	fixed read with new selector (still not sure if this is the right
	fix)

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
@@ -100,7 +100,8 @@
 
     def _findmap(self, selector):
         while isinstance(self, AbstractStoredAttribute):
-            if selector == self.selector:
+            # XXX is this the right fix?
+            if selector == self.selector[:2]:
                 return self
             self = self.back
         return None
@@ -277,11 +278,12 @@
         self._size_estimate = self.length() * NUM_DIGITS_POW2
 
     def _copy_attr(self, obj, new_obj):
-        w_value = self.read(obj, self.selector)
+        #XXX this the right fix?
+        w_value = self.read(obj, self.selector[:2])
         new_obj._get_mapdict_map().add_attr(new_obj, self.selector, w_value)
 
     def delete(self, obj, selector):
-        if selector == self.selector:
+        if selector == self.selector[:2]:
             # ok, attribute is deleted
             return self.back.copy(obj)
         new_obj = self.back.delete(obj, selector)


More information about the pypy-commit mailing list