summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes
diff options
context:
space:
mode:
authorDaniel Stutzbach <daniel@stutzbachenterprises.com>2010-08-31 15:45:04 (GMT)
committerDaniel Stutzbach <daniel@stutzbachenterprises.com>2010-08-31 15:45:04 (GMT)
commit061b14a4a1f64532bfb4d716849ae662c09da62a (patch)
tree3a3fb27784de23a1e4c0c8adfae747c5c36abb6b /Lib/ctypes
parentf5a3d699a7297123f00b4d1680a12f7d08c31237 (diff)
downloadcpython-061b14a4a1f64532bfb4d716849ae662c09da62a.zip
cpython-061b14a4a1f64532bfb4d716849ae662c09da62a.tar.gz
cpython-061b14a4a1f64532bfb4d716849ae662c09da62a.tar.bz2
Reverted r84315 and r84316, with Benjamin's blessing. The tests were
fine. They were failing due to a problem exposed in r84307 and fixed in r84317. See Issue 8781 for details.
Diffstat (limited to 'Lib/ctypes')
-rw-r--r--Lib/ctypes/test/test_parameters.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/ctypes/test/test_parameters.py
index 75ec476..e83fd9a 100644
--- a/Lib/ctypes/test/test_parameters.py
+++ b/Lib/ctypes/test/test_parameters.py
@@ -67,20 +67,19 @@ class SimpleTypesTestCase(unittest.TestCase):
self.assertTrue(c_char_p.from_param(a) is a)
def test_cw_strings(self):
- from ctypes import byref, sizeof
+ from ctypes import byref
try:
- from ctypes import c_wchar, c_wchar_p
+ from ctypes import c_wchar_p
except ImportError:
## print "(No c_wchar_p)"
return
s = "123"
if sys.platform == "win32":
- unisize = 8 if sys.maxunicode == 1114111 else 4
- if unisize == sizeof(c_wchar):
- self.assertIs(c_wchar_p.from_param(s)._obj, s)
- # new in 0.9.1: convert (decode) ascii to unicode
- self.assertEqual(c_wchar_p.from_param("123")._obj, "123")
+ self.assertTrue(c_wchar_p.from_param(s)._obj is s)
self.assertRaises(TypeError, c_wchar_p.from_param, 42)
+
+ # new in 0.9.1: convert (decode) ascii to unicode
+ self.assertEqual(c_wchar_p.from_param("123")._obj, "123")
self.assertRaises(TypeError, c_wchar_p.from_param, b"123\377")
pa = c_wchar_p.from_param(c_wchar_p("123"))