[pypy-commit] pypy default: Fix a few issues with hash(-1)==-2.

arigo pypy.commits at gmail.com
Sun Jul 24 05:36:56 EDT 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r85836:14adc02034c8
Date: 2016-07-24 11:38 +0200
http://bitbucket.org/pypy/pypy/changeset/14adc02034c8/

Log:	Fix a few issues with hash(-1)==-2.

diff --git a/lib-python/2.7/test/test_hash.py b/lib-python/2.7/test/test_hash.py
--- a/lib-python/2.7/test/test_hash.py
+++ b/lib-python/2.7/test/test_hash.py
@@ -174,7 +174,7 @@
 
 class StringlikeHashRandomizationTests(HashRandomizationTests):
     if check_impl_detail(pypy=True):
-        EMPTY_STRING_HASH = -1
+        EMPTY_STRING_HASH = -2
     else:
         EMPTY_STRING_HASH = 0
 
diff --git a/pypy/module/cpyext/test/test_object.py b/pypy/module/cpyext/test/test_object.py
--- a/pypy/module/cpyext/test/test_object.py
+++ b/pypy/module/cpyext/test/test_object.py
@@ -168,7 +168,7 @@
 
     def test_hash(self, space, api):
         assert api.PyObject_Hash(space.wrap(72)) == 72
-        assert api.PyObject_Hash(space.wrap(-1)) == -1
+        assert api.PyObject_Hash(space.wrap(-1)) == -2
         assert (api.PyObject_Hash(space.wrap([])) == -1 and
             api.PyErr_Occurred() is space.w_TypeError)
         api.PyErr_Clear()


More information about the pypy-commit mailing list