diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-03-08 01:33:44 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-03-08 01:33:44 (GMT) |
commit | 763edc1c6a5a212f876c5b6b018a1d2d2054a334 (patch) | |
tree | e0ebc21032a58c4895b57e18116c3b25d233efae /Lib | |
parent | 857b24b0d50dbcca76c9373f904693dacfda4062 (diff) | |
parent | 29c0034ff9ac6b006237d2251866a15c69359b27 (diff) | |
download | cpython-763edc1c6a5a212f876c5b6b018a1d2d2054a334.zip cpython-763edc1c6a5a212f876c5b6b018a1d2d2054a334.tar.gz cpython-763edc1c6a5a212f876c5b6b018a1d2d2054a334.tar.bz2 |
(Merge 3.3) Issue #17223: the test is specific to 32-bit wchar_t type
Skip the test on Windows.
Diffstat (limited to 'Lib')
-rwxr-xr-x | Lib/test/test_array.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index 163dace..a44ee07 100755 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -24,15 +24,7 @@ try: except struct.error: have_long_long = False -try: - import ctypes - sizeof_wchar = ctypes.sizeof(ctypes.c_wchar) -except ImportError: - import sys - if sys.platform == 'win32': - sizeof_wchar = 2 - else: - sizeof_wchar = 4 +sizeof_wchar = array.array('u').itemsize class ArraySubclass(array.array): @@ -1076,8 +1068,8 @@ class UnicodeTest(StringTest, unittest.TestCase): # U+FFFFFFFF is an invalid code point in Unicode 6.0 invalid_str = b'\xff\xff\xff\xff' else: - # invalid UTF-16 surrogate pair - invalid_str = b'\xff\xdf\x61\x00' + # PyUnicode_FromUnicode() cannot fail with 16-bit wchar_t + self.skipTest("specific to 32-bit wchar_t") a = array.array('u', invalid_str) self.assertRaises(ValueError, a.tounicode) self.assertRaises(ValueError, str, a) |