Skip to content

Commit

Permalink
fix: support Python < 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii authored and Ralf W. Grosse-Kunstleve committed Feb 8, 2022
1 parent 3c38b9d commit 6828dc3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions include/pybind11/gil.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ class gil_scoped_release {
auto &internals = detail::get_internals();
tstate = PyEval_SaveThread();
if (disassoc) {
auto *key = internals.tstate;
// Python >= 3.7 can remove this, it's an int before 3.7
// NOLINTNEXTLINE(readability-qualified-auto)
auto key = internals.tstate;
PYBIND11_TLS_DELETE_VALUE(key);
}
}
Expand All @@ -160,7 +162,9 @@ class gil_scoped_release {
PyEval_RestoreThread(tstate);
}
if (disassoc) {
auto *key = detail::get_internals().tstate;
// Python >= 3.7 can remove this, it's an int before 3.7
// NOLINTNEXTLINE(readability-qualified-auto)
auto key = detail::get_internals().tstate;
PYBIND11_TLS_REPLACE_VALUE(key, tstate);
}
}
Expand Down

0 comments on commit 6828dc3

Please sign in to comment.