mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +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:
@@ -88,6 +88,18 @@ AS_IF([test "x$enable_python" != "xno"],[
|
||||
AC_MSG_RESULT([$PYTHON_EXT_SUFFIX])
|
||||
|
||||
AC_CHECK_PROGS([PYCODESTYLE],[pycodestyle],[no])
|
||||
|
||||
dnl Look for some optional symbols in libpython.
|
||||
old_LIBS="$LIBS"
|
||||
|
||||
PYTHON_BLDLIBRARY=`$PYTHON -c "import distutils.sysconfig; \
|
||||
print (distutils.sysconfig.get_config_var('BLDLIBRARY'))"`
|
||||
AC_CHECK_LIB([c],[_Py_IsFinalizing],
|
||||
[AC_DEFINE([HAVE_PY_ISFINALIZING],1,
|
||||
[Found _Py_IsFinalizing in libpython.])],
|
||||
[],[$PYTHON_BLDLIBRARY])
|
||||
|
||||
LIBS="$old_LIBS"
|
||||
fi
|
||||
|
||||
AC_SUBST(PYTHON_PREFIX)
|
||||
|
||||
Reference in New Issue
Block a user