4242
4343def is_gevent_active ():
4444 """Detect if gevent monkey patching is active."""
45+ if python_version >= ("3" , "14" ):
46+ return False
47+
4548 try :
4649 from gevent import monkey
4750 except ImportError : # pragma: no cover
@@ -74,7 +77,9 @@ def raise_thread_exception(thread_id, exception):
7477 _raise_thread_exception_cpython (thread_id , exception )
7578 else :
7679 message = "Setting thread exceptions (%s) is not supported for your current platform (%r)."
77- exctype = (exception if inspect .isclass (exception ) else type (exception )).__name__
80+ exctype = (
81+ exception if inspect .isclass (exception ) else type (exception )
82+ ).__name__
7883 logger .critical (message , exctype , current_platform )
7984
8085
@@ -84,7 +89,11 @@ def _raise_thread_exception_cpython(thread_id, exception):
8489 exception = ctypes .py_object (exception )
8590 count = ctypes .pythonapi .PyThreadState_SetAsyncExc (thread_id , exception )
8691 if count == 0 :
87- logger .critical ("Failed to set exception (%s) in thread %r." , exctype , thread_id .value )
92+ logger .critical (
93+ "Failed to set exception (%s) in thread %r." , exctype , thread_id .value
94+ )
8895 elif count > 1 : # pragma: no cover
89- logger .critical ("Exception (%s) was set in multiple threads. Undoing..." , exctype )
96+ logger .critical (
97+ "Exception (%s) was set in multiple threads. Undoing..." , exctype
98+ )
9099 ctypes .pythonapi .PyThreadState_SetAsyncExc (thread_id , ctypes .c_long (0 ))
0 commit comments