mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
panda: Remove PyEval_InitThreads calls when compiling against Python 3.9+
Closes #1053
This commit is contained in:
parent
b31b100693
commit
54cb519dc9
@ -71,12 +71,12 @@ PythonTask(PyObject *func_or_coro, const std::string &name) :
|
|||||||
|
|
||||||
__dict__ = PyDict_New();
|
__dict__ = PyDict_New();
|
||||||
|
|
||||||
#ifndef SIMPLE_THREADS
|
#if !defined(SIMPLE_THREADS) && defined(WITH_THREAD) && PY_VERSION_HEX < 0x03090000
|
||||||
// Ensure that the Python threading system is initialized and ready to go.
|
// Ensure that the Python threading system is initialized and ready to go.
|
||||||
#ifdef WITH_THREAD // This symbol defined within Python.h
|
// WITH_THREAD symbol defined within Python.h
|
||||||
|
// PyEval_InitThreads is now a deprecated no-op in Python 3.9+
|
||||||
PyEval_InitThreads();
|
PyEval_InitThreads();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,12 +38,12 @@ PythonThread(PyObject *function, PyObject *args,
|
|||||||
|
|
||||||
set_args(args);
|
set_args(args);
|
||||||
|
|
||||||
#ifndef SIMPLE_THREADS
|
#if !defined(SIMPLE_THREADS) && defined(WITH_THREAD) && PY_VERSION_HEX < 0x03090000
|
||||||
// Ensure that the Python threading system is initialized and ready to go.
|
// Ensure that the Python threading system is initialized and ready to go.
|
||||||
#ifdef WITH_THREAD // This symbol defined within Python.h
|
// WITH_THREAD symbol defined within Python.h
|
||||||
|
// PyEval_InitThreads is now a deprecated no-op in Python 3.9+
|
||||||
PyEval_InitThreads();
|
PyEval_InitThreads();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,15 +41,16 @@ PythonCallbackObject(PyObject *function) {
|
|||||||
|
|
||||||
set_function(function);
|
set_function(function);
|
||||||
|
|
||||||
#ifndef SIMPLE_THREADS
|
#if !defined(SIMPLE_THREADS) && defined(WITH_THREAD)
|
||||||
// Ensure that the Python threading system is initialized and ready to go.
|
// Ensure that the Python threading system is initialized and ready to go.
|
||||||
#ifdef WITH_THREAD // This symbol defined within Python.h
|
// WITH_THREAD symbol defined within Python.h
|
||||||
|
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
|
|
||||||
|
#if PY_VERSION_HEX < 0x03090000
|
||||||
|
// PyEval_InitThreads is now a deprecated no-op in Python 3.9+
|
||||||
PyEval_InitThreads();
|
PyEval_InitThreads();
|
||||||
#endif
|
#endif // PY_VERSION_HEX
|
||||||
#endif
|
#endif // WITH_THREAD
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user