mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +00:00
Address Python and PySide API changes
This commit is contained in:
parent
553a8eef5c
commit
93f88263a0
@ -111,6 +111,8 @@ if(CUTTER_ENABLE_PYTHON)
|
|||||||
find_package(Shiboken6Tools "${Shiboken6_VERSION_REQUIRED}" REQUIRED)
|
find_package(Shiboken6Tools "${Shiboken6_VERSION_REQUIRED}" REQUIRED)
|
||||||
find_package(PySide6 "${Shiboken6_VERSION_REQUIRED}" REQUIRED)
|
find_package(PySide6 "${Shiboken6_VERSION_REQUIRED}" REQUIRED)
|
||||||
get_target_property(PYSIDE_INCLUDE_DIR PySide6::pyside6 INTERFACE_INCLUDE_DIRECTORIES)
|
get_target_property(PYSIDE_INCLUDE_DIR PySide6::pyside6 INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
# Check the presence of "pysidecleanup.h"
|
||||||
|
CHECK_INCLUDE_FILE_CXX("pysidecleanup.h" HAVE_PYSIDECLEANUP)
|
||||||
else()
|
else()
|
||||||
# 5.12.3 => 5.12
|
# 5.12.3 => 5.12
|
||||||
if("${Qt5_VERSION}" MATCHES "^([0-9]+\\.[0-9]+)\\.[0-9]+")
|
if("${Qt5_VERSION}" MATCHES "^([0-9]+\\.[0-9]+)\\.[0-9]+")
|
||||||
|
@ -13,6 +13,10 @@
|
|||||||
#ifdef CUTTER_ENABLE_PYTHON_BINDINGS
|
#ifdef CUTTER_ENABLE_PYTHON_BINDINGS
|
||||||
# include <shiboken.h>
|
# include <shiboken.h>
|
||||||
# include <pyside.h>
|
# include <pyside.h>
|
||||||
|
#ifdef HAVE_PYSIDECLEANUP
|
||||||
|
// This header is introduced in PySide 6
|
||||||
|
# include <pysidecleanup.h>
|
||||||
|
#endif
|
||||||
# include <signalmanager.h>
|
# include <signalmanager.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -72,6 +76,7 @@ void PythonManager::initialize()
|
|||||||
PyImport_AppendInittab("CutterBindings", &PyInit_CutterBindings);
|
PyImport_AppendInittab("CutterBindings", &PyInit_CutterBindings);
|
||||||
#endif
|
#endif
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
|
// This function is deprecated does nothing starting from Python 3.9
|
||||||
PyEval_InitThreads();
|
PyEval_InitThreads();
|
||||||
pyThreadStateCounter = 1; // we have the thread now => 1
|
pyThreadStateCounter = 1; // we have the thread now => 1
|
||||||
|
|
||||||
@ -159,7 +164,7 @@ void PythonManager::addPythonPath(char *path)
|
|||||||
if (!append) {
|
if (!append) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PyEval_CallFunction(append, "(s)", path);
|
PyObject_CallFunction(append, "(s)", path);
|
||||||
|
|
||||||
saveThread();
|
saveThread();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user