File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2424except struct .error :
2525 have_long_long = False
2626
27- try :
28- import ctypes
29- sizeof_wchar = ctypes .sizeof (ctypes .c_wchar )
30- except ImportError :
31- import sys
32- if sys .platform == 'win32' :
33- sizeof_wchar = 2
34- else :
35- sizeof_wchar = 4
27+ sizeof_wchar = array .array ('u' ).itemsize
3628
3729
3830class ArraySubclass (array .array ):
@@ -1076,8 +1068,8 @@ def test_issue17223(self):
10761068 # U+FFFFFFFF is an invalid code point in Unicode 6.0
10771069 invalid_str = b'\xff \xff \xff \xff '
10781070 else :
1079- # invalid UTF-16 surrogate pair
1080- invalid_str = b' \xff \xdf \x61 \x00 '
1071+ # PyUnicode_FromUnicode() cannot fail with 16-bit wchar_t
1072+ self . skipTest ( "specific to 32-bit wchar_t" )
10811073 a = array .array ('u' , invalid_str )
10821074 self .assertRaises (ValueError , a .tounicode )
10831075 self .assertRaises (ValueError , str , a )
You can’t perform that action at this time.
0 commit comments