This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 91e9c63b42 [FFI] Add python signal handler for ctypes FFI (#17181)
91e9c63b42 is described below

commit 91e9c63b42fcccec196a8ef9ed7a7bc7f82c2e52
Author: Wuwei Lin <[email protected]>
AuthorDate: Mon Jul 22 16:12:53 2024 -0700

    [FFI] Add python signal handler for ctypes FFI (#17181)
---
 python/tvm/_ffi/_ctypes/packed_func.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/python/tvm/_ffi/_ctypes/packed_func.py 
b/python/tvm/_ffi/_ctypes/packed_func.py
index 6465e0335d..5f3aa04914 100644
--- a/python/tvm/_ffi/_ctypes/packed_func.py
+++ b/python/tvm/_ffi/_ctypes/packed_func.py
@@ -195,6 +195,7 @@ class PackedFuncBase(object):
     """Function base."""
 
     __slots__ = ["handle", "is_global"]
+
     # pylint: disable=no-member
     def __init__(self, handle, is_global):
         """Initialize the function with handle
@@ -342,6 +343,7 @@ def _init_pythonapi_inc_def_ref():
     register_func(c_str("Py_DecRef"), ctypes.pythonapi.Py_DecRef)
     register_func(c_str("PyGILState_Ensure"), 
ctypes.pythonapi.PyGILState_Ensure)
     register_func(c_str("PyGILState_Release"), 
ctypes.pythonapi.PyGILState_Release)
+    register_func(c_str("PyErr_CheckSignals"), 
ctypes.pythonapi.PyErr_CheckSignals)
 
 
 _init_pythonapi_inc_def_ref()

Reply via email to