File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,20 +67,19 @@ def test_cstrings(self):
6767 self .assertTrue (c_char_p .from_param (a ) is a )
6868
6969 def test_cw_strings (self ):
70- from ctypes import byref , sizeof
70+ from ctypes import byref
7171 try :
72- from ctypes import c_wchar , c_wchar_p
72+ from ctypes import c_wchar_p
7373 except ImportError :
7474## print "(No c_wchar_p)"
7575 return
7676 s = "123"
7777 if sys .platform == "win32" :
78- unisize = 8 if sys .maxunicode == 1114111 else 4
79- if unisize == sizeof (c_wchar ):
80- self .assertIs (c_wchar_p .from_param (s )._obj , s )
81- # new in 0.9.1: convert (decode) ascii to unicode
82- self .assertEqual (c_wchar_p .from_param ("123" )._obj , "123" )
78+ self .assertTrue (c_wchar_p .from_param (s )._obj is s )
8379 self .assertRaises (TypeError , c_wchar_p .from_param , 42 )
80+
81+ # new in 0.9.1: convert (decode) ascii to unicode
82+ self .assertEqual (c_wchar_p .from_param ("123" )._obj , "123" )
8483 self .assertRaises (TypeError , c_wchar_p .from_param , b"123\377 " )
8584
8685 pa = c_wchar_p .from_param (c_wchar_p ("123" ))
You can’t perform that action at this time.
0 commit comments