File tree Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -38,24 +38,6 @@ static int hyperion_exec(PyObject* module) {
3838 return 0 ;
3939}
4040
41- // Module creation function for multi-phase init, used in Py_mod_create slot
42- static PyObject* hyperion_create (PyModuleDef* def, PyObject* args) {
43- PyObject* module = PyModule_Create (def);
44- if (!module )
45- {
46- return NULL ;
47- }
48-
49- // Execute any additional module initialization logic
50- if (hyperion_exec (module ) < 0 )
51- {
52- Py_DECREF (module );
53- return NULL ;
54- }
55-
56- return module ;
57- }
58-
5941// Module deallocation function to clean up per-interpreter state
6042static void hyperion_free (void * /* module */ )
6143{
Original file line number Diff line number Diff line change @@ -81,9 +81,11 @@ void PythonProgram::execute(const QByteArray& python_code)
8181 {
8282 return ;
8383 }
84-
84+ #if (PY_VERSION_HEX < 0x030C0000)
85+ PyThreadState_Swap (_tstate);
86+ #else
8587 PyThreadState* prev_thread_state = PyThreadState_Swap (_tstate);
86-
88+ # endif
8789 PyObject* main_module = PyImport_ImportModule (" __main__" );
8890 if (!main_module)
8991 {
You can’t perform that action at this time.
0 commit comments