From 69367272ec8a5408e54534c868634bf0290f08b6 Mon Sep 17 00:00:00 2001 From: Mark Glines Date: Thu, 14 Jan 2021 07:13:43 -0500 Subject: [PATCH] Fix warnings in python bindings --- python_bindings/pybind11/include/pybind11/detail/common.h | 2 +- python_bindings/pybind11/include/pybind11/detail/internals.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/python_bindings/pybind11/include/pybind11/detail/common.h b/python_bindings/pybind11/include/pybind11/detail/common.h index 5ff74856b..3bcdc433e 100644 --- a/python_bindings/pybind11/include/pybind11/detail/common.h +++ b/python_bindings/pybind11/include/pybind11/detail/common.h @@ -648,7 +648,7 @@ inline void ignore_unused(const int *) { } #define PYBIND11_EXPAND_SIDE_EFFECTS(PATTERN) (((PATTERN), void()), ...) #else using expand_side_effects = bool[]; -#define PYBIND11_EXPAND_SIDE_EFFECTS(PATTERN) pybind11::detail::expand_side_effects{ ((PATTERN), void(), false)..., false } +#define PYBIND11_EXPAND_SIDE_EFFECTS(PATTERN) (void)pybind11::detail::expand_side_effects{ ((PATTERN), void(), false)..., false } #endif NAMESPACE_END(detail) diff --git a/python_bindings/pybind11/include/pybind11/detail/internals.h b/python_bindings/pybind11/include/pybind11/detail/internals.h index 6d7dc5cfe..594f0a7ac 100644 --- a/python_bindings/pybind11/include/pybind11/detail/internals.h +++ b/python_bindings/pybind11/include/pybind11/detail/internals.h @@ -197,7 +197,10 @@ PYBIND11_NOINLINE inline internals &get_internals() { auto *&internals_ptr = *internals_pp; internals_ptr = new internals(); #if defined(WITH_THREAD) - PyEval_InitThreads(); + +# if PY_VERSION_HEX < 0x03090000 + PyEval_InitThreads(); +# endif PyThreadState *tstate = PyThreadState_Get(); #if PY_VERSION_HEX >= 0x03070000 internals_ptr->tstate = PyThread_tss_alloc();