[pypy-commit] pypy default: (cfbolz, arigo) Fix.

arigo noreply at buildbot.pypy.org
Tue May 17 12:48:46 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r44234:78fefaebb1b3
Date: 2011-05-17 11:38 +0200
http://bitbucket.org/pypy/pypy/changeset/78fefaebb1b3/

Log:	(cfbolz, arigo) 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
@@ -769,6 +769,8 @@
             if selector[1] != INVALID:
                 index = map.index(selector)
                 if index >= 0:
+                    # note that if map.terminator is a DevolvedDictTerminator,
+                    # map.index() will always return -1 if selector[1]==DICT
                     _fill_cache(pycode, nameindex, map, version_tag, index)
                     return w_obj._mapdict_read_storage(index)
     if space.config.objspace.std.withmethodcachecounter:
@@ -793,6 +795,6 @@
     if version_tag is None:
         return
     map = w_obj._get_mapdict_map()
-    if map is None:
+    if map is None or isinstance(map.terminator, DevolvedDictTerminator):
         return
     _fill_cache(pycode, nameindex, map, version_tag, -1, w_method)


More information about the pypy-commit mailing list