[pypy-svn] r68461 - pypy/branch/gc-hash/pypy/annotation

arigo at codespeak.net arigo at codespeak.net
Wed Oct 14 19:00:25 CEST 2009


Author: arigo
Date: Wed Oct 14 19:00:24 2009
New Revision: 68461

Modified:
   pypy/branch/gc-hash/pypy/annotation/dictdef.py
Log:
Fix.


Modified: pypy/branch/gc-hash/pypy/annotation/dictdef.py
==============================================================================
--- pypy/branch/gc-hash/pypy/annotation/dictdef.py	(original)
+++ pypy/branch/gc-hash/pypy/annotation/dictdef.py	Wed Oct 14 19:00:24 2009
@@ -133,7 +133,12 @@
         self.dictvalue.generalize(s_value)
 
     def seen_prebuilt_key(self, x):
-        compute_hash(x)
+        # In case we are an r_dict, we don't ask for the hash ourselves.
+        # Note that if the custom hashing function ends up asking for
+        # the hash of x, then it must use compute_hash() itself, so it
+        # works out.
+        if not self.dictkey.is_r_dict:
+            compute_hash(x)
 
     def __repr__(self):
         return '<{%r: %r}>' % (self.dictkey.s_value, self.dictvalue.s_value)



More information about the Pypy-commit mailing list