Skip to content

Commit 6828dc3

Browse files
henryiiirwgk
authored andcommitted
fix: support Python < 3.6
1 parent 3c38b9d commit 6828dc3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

include/pybind11/gil.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ class gil_scoped_release {
137137
auto &internals = detail::get_internals();
138138
tstate = PyEval_SaveThread();
139139
if (disassoc) {
140-
auto *key = internals.tstate;
140+
// Python >= 3.7 can remove this, it's an int before 3.7
141+
// NOLINTNEXTLINE(readability-qualified-auto)
142+
auto key = internals.tstate;
141143
PYBIND11_TLS_DELETE_VALUE(key);
142144
}
143145
}
@@ -160,7 +162,9 @@ class gil_scoped_release {
160162
PyEval_RestoreThread(tstate);
161163
}
162164
if (disassoc) {
163-
auto *key = detail::get_internals().tstate;
165+
// Python >= 3.7 can remove this, it's an int before 3.7
166+
// NOLINTNEXTLINE(readability-qualified-auto)
167+
auto key = detail::get_internals().tstate;
164168
PYBIND11_TLS_REPLACE_VALUE(key, tstate);
165169
}
166170
}

0 commit comments

Comments
 (0)