From 2547ca468c8f3860e0fac92da40f5d8a8802e3cc Mon Sep 17 00:00:00 2001 From: Felipe Lema Date: Mon, 25 Jan 2016 16:22:44 -0300 Subject: [PATCH] deal with Python versions compiled without thread support (fixes #81) --- include/pybind11/pybind11.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 166966a1c..e86a7fa2c 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -983,6 +983,7 @@ template void implicitly_convertible() ((detail::type_info *) it->second)->implicit_conversions.push_back(implicit_caster); } +#if defined(WITH_THREAD) inline void init_threading() { PyEval_InitThreads(); } class gil_scoped_acquire { @@ -998,6 +999,7 @@ public: inline gil_scoped_release() { state = PyEval_SaveThread(); } inline ~gil_scoped_release() { PyEval_RestoreThread(state); } }; +#endif inline function get_overload(const void *this_ptr, const char *name) { handle py_object = detail::get_object_handle(this_ptr);