Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 73cfd79

Browse files
Fix test_from_dll* in test_returnfuncptrs.py.
2 parents b36f7d7 + f5d245a commit 73cfd79

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

Lib/ctypes/test/test_returnfuncptrs.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,30 @@ def test_without_prototype(self):
3434
self.assertRaises(ArgumentError, strchr, b"abcdef", 3.0)
3535
self.assertRaises(TypeError, strchr, b"abcdef")
3636

37-
@unittest.skipIf(os.name == 'nt', 'Temporarily disabled for Windows')
3837
def test_from_dll(self):
3938
dll = CDLL(_ctypes_test.__file__)
4039
# _CFuncPtr instances are now callable with a tuple argument
4140
# which denotes a function name and a dll:
42-
strchr = CFUNCTYPE(c_char_p, c_char_p, c_char)(("strchr", dll))
41+
strchr = CFUNCTYPE(c_char_p, c_char_p, c_char)(("my_strchr", dll))
4342
self.assertTrue(strchr(b"abcdef", b"b"), "bcdef")
4443
self.assertEqual(strchr(b"abcdef", b"x"), None)
4544
self.assertRaises(ArgumentError, strchr, b"abcdef", 3.0)
4645
self.assertRaises(TypeError, strchr, b"abcdef")
4746

48-
@unittest.skipIf(os.name == 'nt', 'Temporarily disabled for Windows')
4947
# Issue 6083: Reference counting bug
5048
def test_from_dll_refcount(self):
5149
class BadSequence(tuple):
5250
def __getitem__(self, key):
5351
if key == 0:
54-
return "strchr"
52+
return "my_strchr"
5553
if key == 1:
5654
return CDLL(_ctypes_test.__file__)
5755
raise IndexError
5856

5957
# _CFuncPtr instances are now callable with a tuple argument
6058
# which denotes a function name and a dll:
61-
strchr = CFUNCTYPE(c_char_p, c_char_p, c_char)(BadSequence(("strchr", CDLL(_ctypes_test.__file__))))
59+
strchr = CFUNCTYPE(c_char_p, c_char_p, c_char)(
60+
BadSequence(("my_strchr", CDLL(_ctypes_test.__file__))))
6261
self.assertTrue(strchr(b"abcdef", b"b"), "bcdef")
6362
self.assertEqual(strchr(b"abcdef", b"x"), None)
6463
self.assertRaises(ArgumentError, strchr, b"abcdef", 3.0)

0 commit comments

Comments
 (0)