Skip to content

Commit

Permalink
Enabling PyGILState_Check() for Python >= 3.6 only.
Browse files Browse the repository at this point in the history
Possibly, this explains why PyGILState_Check() cannot safely be used with Python 3.4 and 3.5:

python/cpython#10267 (comment)
  • Loading branch information
Ralf W. Grosse-Kunstleve committed Apr 2, 2021
1 parent 64e47cd commit 75cc8bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/pybind11/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ unpacking_collector<policy> collect_arguments(Args &&...args) {
template <typename Derived>
template <return_value_policy policy, typename... Args>
object object_api<Derived>::operator()(Args &&...args) const {
#if PY_VERSION_HEX >= 0x03040000
#if PY_VERSION_HEX >= 0x03060000
if (!PyGILState_Check()) {
pybind11_fail("pybind11::object_api<>::operator() PyGILState_Check() failure.");
}
Expand Down

0 comments on commit 75cc8bd

Please sign in to comment.