Skip to content

Commit 63f0695

Browse files
committed
fix: support Python < 3.6
1 parent 9057962 commit 63f0695

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

include/pybind11/gil.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ class gil_scoped_release {
130130
auto &internals = detail::get_internals();
131131
tstate = PyEval_SaveThread();
132132
if (disassoc) {
133-
auto *key = internals.tstate;
133+
// Python >= 3.7 can remove this, it's an int before 3.7
134+
// NOLINTNEXTLINE(readability-qualified-auto)
135+
auto key = internals.tstate;
134136
PYBIND11_TLS_DELETE_VALUE(key);
135137
}
136138
}
@@ -149,7 +151,9 @@ class gil_scoped_release {
149151
if (active)
150152
PyEval_RestoreThread(tstate);
151153
if (disassoc) {
152-
auto *key = detail::get_internals().tstate;
154+
// Python >= 3.7 can remove this, it's an int before 3.7
155+
// NOLINTNEXTLINE(readability-qualified-auto)
156+
auto key = detail::get_internals().tstate;
153157
PYBIND11_TLS_REPLACE_VALUE(key, tstate);
154158
}
155159
}

0 commit comments

Comments
 (0)