MCPcopy Create free account
hub / github.com/pybind/pybind11 / with_exception_translators

Function with_exception_translators

include/pybind11/detail/internals.h:969–979  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

967
968template <typename F>
969inline auto with_exception_translators(const F &cb)
970 -> decltype(cb(get_internals().registered_exception_translators,
971 get_local_internals().registered_exception_translators)) {
972 auto &internals = get_internals();
973#ifdef Py_GIL_DISABLED
974 pycritical_section lock((internals).exception_translator_mutex);
975#endif
976 auto &local_internals = get_local_internals();
977 return cb(internals.registered_exception_translators,
978 local_internals.registered_exception_translators);
979}
980
981inline std::uint64_t mix64(std::uint64_t z) {
982 // David Stafford's variant 13 of the MurmurHash3 finalizer popularized

Calls 1

cbFunction · 0.85

Tested by

no test coverage detected