File tree Expand file tree Collapse file tree 2 files changed +0
-19
lines changed Expand file tree Collapse file tree 2 files changed +0
-19
lines changed Original file line number Diff line number Diff line change 265265# define PYBIND11_HAS_U8STRING
266266#endif
267267
268- // See description of PR #4246:
269- #if !defined(NDEBUG) && !defined(PY_ASSERT_GIL_HELD_INCREF_DECREF) \
270- && !(defined (PYPY_VERSION) \
271- && defined (_MSC_VER)) /* PyPy Windows: pytest hangs indefinitely at the end of the \
272- process (see PR #4268) */ \
273- && !defined (PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF)
274- # define PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF
275- #endif
276-
277268// #define PYBIND11_STR_LEGACY_PERMISSIVE
278269// If DEFINED, pybind11::str can hold PyUnicodeObject or PyBytesObject
279270// (probably surprising and never documented, but this was the
Original file line number Diff line number Diff line change @@ -246,11 +246,6 @@ class handle : public detail::object_api<handle> {
246246 const handle &inc_ref () const & {
247247#ifdef PYBIND11_HANDLE_REF_DEBUG
248248 inc_ref_counter (1 );
249- #endif
250- #if defined(PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF)
251- if (m_ptr != nullptr && !PyGILState_Check ()) {
252- throw std::runtime_error (" pybind11::handle::inc_ref() PyGILState_Check() failure." );
253- }
254249#endif
255250 Py_XINCREF (m_ptr);
256251 return *this ;
@@ -262,11 +257,6 @@ class handle : public detail::object_api<handle> {
262257 this function automatically. Returns a reference to itself.
263258 \endrst */
264259 const handle &dec_ref () const & {
265- #if defined(PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF)
266- if (m_ptr != nullptr && !PyGILState_Check ()) {
267- throw std::runtime_error (" pybind11::handle::dec_ref() PyGILState_Check() failure." );
268- }
269- #endif
270260 Py_XDECREF (m_ptr);
271261 return *this ;
272262 }
You can’t perform that action at this time.
0 commit comments