mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #17223: the test is specific to 32-bit wchar_t type
Skip the test on Windows.
This commit is contained in:
parent
965794ed58
commit
29c0034ff9
1 changed files with 3 additions and 11 deletions
|
@ -24,15 +24,7 @@ try:
|
||||||
except struct.error:
|
except struct.error:
|
||||||
have_long_long = False
|
have_long_long = False
|
||||||
|
|
||||||
try:
|
sizeof_wchar = array.array('u').itemsize
|
||||||
import ctypes
|
|
||||||
sizeof_wchar = ctypes.sizeof(ctypes.c_wchar)
|
|
||||||
except ImportError:
|
|
||||||
import sys
|
|
||||||
if sys.platform == 'win32':
|
|
||||||
sizeof_wchar = 2
|
|
||||||
else:
|
|
||||||
sizeof_wchar = 4
|
|
||||||
|
|
||||||
|
|
||||||
class ArraySubclass(array.array):
|
class ArraySubclass(array.array):
|
||||||
|
@ -1076,8 +1068,8 @@ class UnicodeTest(StringTest, unittest.TestCase):
|
||||||
# U+FFFFFFFF is an invalid code point in Unicode 6.0
|
# U+FFFFFFFF is an invalid code point in Unicode 6.0
|
||||||
invalid_str = b'\xff\xff\xff\xff'
|
invalid_str = b'\xff\xff\xff\xff'
|
||||||
else:
|
else:
|
||||||
# invalid UTF-16 surrogate pair
|
# PyUnicode_FromUnicode() cannot fail with 16-bit wchar_t
|
||||||
invalid_str = b'\xff\xdf\x61\x00'
|
self.skipTest("specific to 32-bit wchar_t")
|
||||||
a = array.array('u', invalid_str)
|
a = array.array('u', invalid_str)
|
||||||
self.assertRaises(ValueError, a.tounicode)
|
self.assertRaises(ValueError, a.tounicode)
|
||||||
self.assertRaises(ValueError, str, a)
|
self.assertRaises(ValueError, str, a)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue