Skip to content

Commit 694bbd2

Browse files
committed
Use CDLL directly.
1 parent c7dcc58 commit 694bbd2

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎Lib/test/test_ctypes/test_callbacks.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
c_short, c_ushort, c_int, c_uint,
1212
c_long, c_longlong, c_ulonglong, c_ulong,
1313
c_float, c_double, c_longdouble, py_object)
14-
from ctypes.util import find_library, wrap_dll_function
14+
from ctypes.util import find_library
1515
from test import support
1616
from test.support import import_helper
1717
_ctypes_test = import_helper.import_module("_ctypes_test")
@@ -332,9 +332,10 @@ def test_narrow_int_return_widened(self):
332332
# gh-156933: Narrow integers were not widened on s390x
333333
CALLBACK = CFUNCTYPE(c_int)
334334

335-
@wrap_dll_function(CDLL(_ctypes_test.__file__))
336-
def _testfunc_callback_int_to_longlong(func: CALLBACK) -> c_longlong:
337-
pass
335+
dll = CDLL(_ctypes_test.__file__)
336+
_testfunc_callback_int_to_longlong = dll._testfunc_callback_int_to_longlong
337+
_testfunc_callback_int_to_longlong.argtypes = [CALLBACK]
338+
_testfunc_callback_int_to_longlong.restype = c_longlong
338339

339340
@CALLBACK
340341
def cb():

0 commit comments

Comments
 (0)