Merge pull request #222 from ijl/pymodinit2

Fix pymodinit for python2
This commit is contained in:
konstin 2018-09-15 01:19:52 +02:00 committed by GitHub
commit f8adb456b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,7 +64,7 @@ pub fn py2_init(fnname: &syn::Ident, name: &syn::Ident, doc: syn::Lit) -> TokenS
pub unsafe extern "C" fn #cb_name() {
// initialize python
::pyo3::init_once();
::pyo3::ffi::PyEval_InitThreads_if_with_thread();
::pyo3::PyEval_InitThreads_if_with_thread();
let _name = concat!(stringify!(#name), "\0").as_ptr() as *const _;
let _pool = ::pyo3::GILPool::new();