-
Notifications
You must be signed in to change notification settings - Fork 763
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gil: try to initialize threads on Python 3.6 if possible
- Loading branch information
1 parent
b79a261
commit 5a35a9d
Showing
3 changed files
with
34 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// This test checks Python initialization on python 3.6, so needs to be standalone in its own process. | ||
|
||
#[test] | ||
fn test_py36_init_threads() { | ||
unsafe { pyo3::ffi::Py_InitializeEx(0) }; | ||
pyo3::prepare_freethreaded_python(); | ||
assert_eq!(unsafe { pyo3::ffi::PyEval_ThreadsInitialized() }, 1); | ||
} |