diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-01-31 17:59:10 +0300 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-02-09 19:16:40 +0300 |
commit | c88ff01faaf3dbc93564a15e930bb533a56516d1 (patch) | |
tree | 6172c63a181460fbcd40a7fbea97f3ed8f41bd39 /contrib/libs | |
parent | 22faf7825187091e0ac85a196aab658c151f83be (diff) | |
download | ydb-c88ff01faaf3dbc93564a15e930bb533a56516d1.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/libs')
-rw-r--r-- | contrib/libs/pybind11/include/pybind11/pytypes.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/libs/pybind11/include/pybind11/pytypes.h b/contrib/libs/pybind11/include/pybind11/pytypes.h index fcad4c609e..6c255c6cde 100644 --- a/contrib/libs/pybind11/include/pybind11/pytypes.h +++ b/contrib/libs/pybind11/include/pybind11/pytypes.h @@ -265,6 +265,11 @@ public: this function automatically. Returns a reference to itself. \endrst */ const handle &dec_ref() const & { +#ifdef Py_DEBUG + if (!Py_IsInitialized()) { + return *this; + } +#endif #ifdef PYBIND11_ASSERT_GIL_HELD_INCREF_DECREF if (m_ptr != nullptr && !PyGILState_Check()) { throw_gilstate_error("pybind11::handle::dec_ref()"); |