Skip to content

Commit

Permalink
Merge pull request #374 from Infinoid/python-warnings
Browse files Browse the repository at this point in the history
Fix warnings in python bindings
  • Loading branch information
stephenchouca authored Jan 20, 2021
2 parents fda53cd + 6936727 commit bc5a580
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python_bindings/pybind11/include/pybind11/detail/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 4 additions & 1 deletion python_bindings/pybind11/include/pybind11/detail/internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit bc5a580

Please sign in to comment.