File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,9 @@ struct internals {
170170 PyTypeObject *default_metaclass;
171171 PyObject *instance_base;
172172#if defined(WITH_THREAD)
173+ # if PYBIND11_INTERNALS_VERSION > 5
173174 PYBIND11_TLS_KEY_INIT (tstate)
175+ # endif // PYBIND11_INTERNALS_VERSION > 5
174176# if PYBIND11_INTERNALS_VERSION > 4
175177 PYBIND11_TLS_KEY_INIT (loader_life_support_tls_key)
176178# endif // PYBIND11_INTERNALS_VERSION > 4
@@ -180,6 +182,7 @@ struct internals {
180182 PYBIND11_TLS_FREE (loader_life_support_tls_key);
181183# endif // PYBIND11_INTERNALS_VERSION > 4
182184
185+ # if PYBIND11_INTERNALS_VERSION > 5
183186 // This destructor is called *after* Py_Finalize() in finalize_interpreter().
184187 // That *SHOULD BE* fine. The following details what happens when PyThread_tss_free is
185188 // called. PYBIND11_TLS_FREE is PyThread_tss_free on python 3.7+. On older python, it does
@@ -188,6 +191,7 @@ struct internals {
188191 // Neither of those have anything to do with CPython internals. PyMem_RawFree *requires*
189192 // that the `tstate` be allocated with the CPython allocator.
190193 PYBIND11_TLS_FREE (tstate);
194+ # endif // PYBIND11_INTERNALS_VERSION > 5
191195 }
192196#endif
193197};
You can’t perform that action at this time.
0 commit comments