Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef6ff66 commit b35f646Copy full SHA for b35f646
1 file changed
Lib/ctypes/test/test_parameters.py
@@ -67,15 +67,17 @@ def test_cstrings(self):
67
self.assertTrue(c_char_p.from_param(a) is a)
68
69
def test_cw_strings(self):
70
- from ctypes import byref
+ from ctypes import byref, sizeof
71
try:
72
- from ctypes import c_wchar_p
+ from ctypes import c_wchar, c_wchar_p
73
except ImportError:
74
## print "(No c_wchar_p)"
75
return
76
s = "123"
77
if sys.platform == "win32":
78
- self.assertTrue(c_wchar_p.from_param(s)._obj is s)
+ 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
self.assertRaises(TypeError, c_wchar_p.from_param, 42)
82
83
# new in 0.9.1: convert (decode) ascii to unicode
0 commit comments