Skip to content

Commit 91e9c63

Browse files
authored
[FFI] Add python signal handler for ctypes FFI (#17181)
1 parent 929b8f4 commit 91e9c63

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

python/tvm/_ffi/_ctypes/packed_func.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ class PackedFuncBase(object):
195195
"""Function base."""
196196

197197
__slots__ = ["handle", "is_global"]
198+
198199
# pylint: disable=no-member
199200
def __init__(self, handle, is_global):
200201
"""Initialize the function with handle
@@ -342,6 +343,7 @@ def _init_pythonapi_inc_def_ref():
342343
register_func(c_str("Py_DecRef"), ctypes.pythonapi.Py_DecRef)
343344
register_func(c_str("PyGILState_Ensure"), ctypes.pythonapi.PyGILState_Ensure)
344345
register_func(c_str("PyGILState_Release"), ctypes.pythonapi.PyGILState_Release)
346+
register_func(c_str("PyErr_CheckSignals"), ctypes.pythonapi.PyErr_CheckSignals)
345347

346348

347349
_init_pythonapi_inc_def_ref()

0 commit comments

Comments
 (0)