Author: Amaury Forgeot d'Arc <amaur...@gmail.com> Branch: py3k Changeset: r75815:8b50f6d3aebe Date: 2015-02-10 22:20 +0100 http://bitbucket.org/pypy/pypy/changeset/8b50f6d3aebe/
Log: Fix a corner case where a key of module.__dict__ could be retrieved as a bytes object. Probably fixes translation as well diff --git a/pypy/objspace/std/celldict.py b/pypy/objspace/std/celldict.py --- a/pypy/objspace/std/celldict.py +++ b/pypy/objspace/std/celldict.py @@ -123,7 +123,7 @@ def w_keys(self, w_dict): space = self.space l = self.unerase(w_dict.dstorage).keys() - return space.newlist_bytes(l) + return space.newlist_unicode(l) def values(self, w_dict): iterator = self.unerase(w_dict.dstorage).itervalues diff --git a/pypy/objspace/std/test/test_celldict.py b/pypy/objspace/std/test/test_celldict.py --- a/pypy/objspace/std/test/test_celldict.py +++ b/pypy/objspace/std/test/test_celldict.py @@ -106,6 +106,11 @@ assert "s" not in d assert F() not in d + def test_reversed(self): + import __pypy__ + name = next(__pypy__.reversed_dict(__pypy__.__dict__)) + assert isinstance(name, str) + class TestModuleDictImplementation(BaseTestRDictImplementation): StrategyClass = ModuleDictStrategy _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit