diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-01-31 17:59:10 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-01-31 18:43:19 +0300 |
commit | 812e7e202ea3ff85db090a5c171e542a24f73c88 (patch) | |
tree | 2d27e71700f179093129d1470b3b081083ef44ec /contrib/libs/pybind11 | |
parent | 9cde6ebc1cd157b794b58775da2b284b6a3871ae (diff) | |
download | ydb-812e7e202ea3ff85db090a5c171e542a24f73c88.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib/libs/pybind11')
-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()"); |