summaryrefslogtreecommitdiffstats
path: root/Lib/ctypes
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2014-11-01 22:14:27 (GMT)
committerSteve Dower <steve.dower@microsoft.com>2014-11-01 22:14:27 (GMT)
commit53683965aaf2895fbdb851e07436c6f86b48d0dc (patch)
tree20236e8b0b95673105bdbe8f1e52099310a8bbb6 /Lib/ctypes
parent86e9deb5aabd581316b7da556f506b07be982526 (diff)
downloadcpython-53683965aaf2895fbdb851e07436c6f86b48d0dc.zip
cpython-53683965aaf2895fbdb851e07436c6f86b48d0dc.tar.gz
cpython-53683965aaf2895fbdb851e07436c6f86b48d0dc.tar.bz2
#22732 ctypes tests don't set correct restype for intptr_t functions
Diffstat (limited to 'Lib/ctypes')
-rw-r--r--Lib/ctypes/test/test_pointers.py5
-rw-r--r--Lib/ctypes/test/test_prototypes.py5
2 files changed, 8 insertions, 2 deletions
diff --git a/Lib/ctypes/test/test_pointers.py b/Lib/ctypes/test/test_pointers.py
index 4cd3a7a..78e3357 100644
--- a/Lib/ctypes/test/test_pointers.py
+++ b/Lib/ctypes/test/test_pointers.py
@@ -24,7 +24,10 @@ class PointersTestCase(unittest.TestCase):
def test_pass_pointers(self):
dll = CDLL(_ctypes_test.__file__)
func = dll._testfunc_p_p
- func.restype = c_long
+ if sizeof(c_longlong) == sizeof(c_void_p):
+ func.restype = c_longlong
+ else:
+ func.restype = c_long
i = c_int(12345678)
## func.argtypes = (POINTER(c_int),)
diff --git a/Lib/ctypes/test/test_prototypes.py b/Lib/ctypes/test/test_prototypes.py
index 818c111..cd0c649 100644
--- a/Lib/ctypes/test/test_prototypes.py
+++ b/Lib/ctypes/test/test_prototypes.py
@@ -69,7 +69,10 @@ class CharPointersTestCase(unittest.TestCase):
def test_int_pointer_arg(self):
func = testdll._testfunc_p_p
- func.restype = c_long
+ if sizeof(c_longlong) == sizeof(c_void_p):
+ func.restype = c_longlong
+ else:
+ func.restype = c_long
self.assertEqual(0, func(0))
ci = c_int(0)