[Python-checkins] cpython (3.3): Backport fc8f1b1c76bf.

stefan.krah python-checkins at python.org
Tue Nov 6 23:56:36 CET 2012


http://hg.python.org/cpython/rev/55cc29d7e83a
changeset:   80282:55cc29d7e83a
branch:      3.3
parent:      80271:e99e7e2f61d2
user:        Stefan Krah <skrah at bytereef.org>
date:        Tue Nov 06 23:27:24 2012 +0100
summary:
  Backport fc8f1b1c76bf.

files:
  Lib/test/test_buffer.py |  20 +++++---------------
  1 files changed, 5 insertions(+), 15 deletions(-)


diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -4001,23 +4001,13 @@
 
         # equality-hash invariant
         x = ndarray(list(range(12)), shape=[12], format='B')
-        a = memoryview(nd)
+        a = memoryview(x)
 
         y = ndarray(list(range(12)), shape=[12], format='b')
-        b = memoryview(nd)
-
-        z = ndarray(list(bytes(chr(x), 'latin-1') for x in range(12)),
-                    shape=[12], format='c')
-        c = memoryview(nd)
-
-        if (a == b):
-            self.assertEqual(hash(a), hash(b))
-
-        if (a == c):
-            self.assertEqual(hash(a), hash(c))
-
-        if (b == c):
-            self.assertEqual(hash(b), hash(c))
+        b = memoryview(y)
+
+        self.assertEqual(a, b)
+        self.assertEqual(hash(a), hash(b))
 
         # non-byte formats
         nd = ndarray(list(range(12)), shape=[2,2,3], format='L')

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list