summaryrefslogtreecommitdiff
path: root/Lib/test/test_array.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-09-30 00:51:10 +0200
committerVictor Stinner <victor.stinner@haypocalc.com>2011-09-30 00:51:10 +0200
commit8dba4e004fc07b8f651770c9a4beb87cad0189e4 (patch)
treed4f9135968943f0645a61815bd0dd2318c19d863 /Lib/test/test_array.py
parentf8bb7d02f62d5bae1fdbbabc7bc66b6b3f19abd3 (diff)
downloadcpython-git-8dba4e004fc07b8f651770c9a4beb87cad0189e4.tar.gz
array module uses the new Unicode API
* Use Py_UCS4* buffer instead of Py_UNICODE* * Use "I" or "L" format, instead of "u" format
Diffstat (limited to 'Lib/test/test_array.py')
-rwxr-xr-xLib/test/test_array.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 604dcdf8a5..fc17b428ff 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -218,10 +218,14 @@ class BaseTest(unittest.TestCase):
self.assertEqual(bi[1], len(a))
def test_byteswap(self):
- a = array.array(self.typecode, self.example)
+ if self.typecode == 'u':
+ example = '\U00100100'
+ else:
+ example = self.example
+ a = array.array(self.typecode, example)
self.assertRaises(TypeError, a.byteswap, 42)
if a.itemsize in (1, 2, 4, 8):
- b = array.array(self.typecode, self.example)
+ b = array.array(self.typecode, example)
b.byteswap()
if a.itemsize==1:
self.assertEqual(a, b)