[pypy-commit] pypy py3k-fix-strategies: another bytes strat fix

pjenvey noreply at buildbot.pypy.org
Mon Apr 21 22:49:56 CEST 2014


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k-fix-strategies
Changeset: r70836:1a810f29fb28
Date: 2014-04-21 13:25 -0700
http://bitbucket.org/pypy/pypy/changeset/1a810f29fb28/

Log:	another bytes strat fix

diff --git a/pypy/objspace/std/dictmultiobject.py b/pypy/objspace/std/dictmultiobject.py
--- a/pypy/objspace/std/dictmultiobject.py
+++ b/pypy/objspace/std/dictmultiobject.py
@@ -821,7 +821,7 @@
     unerase = staticmethod(unerase)
 
     def wrap(self, unwrapped):
-        return self.space.wrap(unwrapped)
+        return self.space.wrapbytes(unwrapped)
 
     def unwrap(self, wrapped):
         return self.space.bytes_w(wrapped)
diff --git a/pypy/objspace/std/test/test_dictmultiobject.py b/pypy/objspace/std/test/test_dictmultiobject.py
--- a/pypy/objspace/std/test/test_dictmultiobject.py
+++ b/pypy/objspace/std/test/test_dictmultiobject.py
@@ -1015,6 +1015,11 @@
         # gives us (1, 2), but 1 is not in the dict any longer.
         #raises(RuntimeError, list, it)
 
+    def test_bytes_to_object(self):
+        d = {b'a': 'b'}
+        d[object()] = None
+        assert b'a' in list(d)
+
 
 class FakeString(str):
 


More information about the pypy-commit mailing list