Use assert_ne for checking thread initialization
This commit is contained in:
parent
dc2dbd6c19
commit
839f13ea21
|
@ -64,7 +64,7 @@ pub fn prepare_freethreaded_python() {
|
||||||
if ffi::Py_IsInitialized() != 0 {
|
if ffi::Py_IsInitialized() != 0 {
|
||||||
// If Python is already initialized, we expect Python threading to also be initialized,
|
// If Python is already initialized, we expect Python threading to also be initialized,
|
||||||
// as we can't make the existing Python main thread acquire the GIL.
|
// as we can't make the existing Python main thread acquire the GIL.
|
||||||
debug_assert_ne!(ffi::PyEval_ThreadsInitialized(), 0);
|
assert_ne!(ffi::PyEval_ThreadsInitialized(), 0);
|
||||||
} else {
|
} else {
|
||||||
// Initialize Python.
|
// Initialize Python.
|
||||||
// We use Py_InitializeEx() with initsigs=0 to disable Python signal handling.
|
// We use Py_InitializeEx() with initsigs=0 to disable Python signal handling.
|
||||||
|
|
Loading…
Reference in a new issue