mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
RHEL 7: python: Check for _Py_IsFinalizing.
This symbol is not present in Python 2.7 or 3.6. It's not really
necessary to call this, it just avoids a crash in certain corner cases
when the interpreter is shutting down. So make the call conditional
on the function existing.
Fixes commit e6f9e0b0f6.
This commit is contained in:
@@ -121,8 +121,10 @@ guestfs_int_py_event_callback_wrapper (guestfs_h *g,
|
||||
PyObject *py_r;
|
||||
int threads_initialized = PyEval_ThreadsInitialized ();
|
||||
|
||||
#ifdef HAVE_PY_ISFINALIZING
|
||||
if (_Py_IsFinalizing ())
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (threads_initialized)
|
||||
py_save = PyGILState_Ensure ();
|
||||
|
||||
Reference in New Issue
Block a user