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

Function PyWarning_Check

include/pybind11/warnings.h:19–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17PYBIND11_NAMESPACE_BEGIN(detail)
18
19inline bool PyWarning_Check(PyObject *obj) {
20 int result = PyObject_IsSubclass(obj, PyExc_Warning);
21 if (result == 1) {
22 return true;
23 }
24 if (result == -1) {
25 raise_from(PyExc_SystemError,
26 "pybind11::detail::PyWarning_Check(): PyObject_IsSubclass() call failed.");
27 throw error_already_set();
28 }
29 return false;
30}
31
32PYBIND11_NAMESPACE_END(detail)
33

Callers 2

new_warning_typeFunction · 0.85
warnFunction · 0.85

Calls 1

raise_fromFunction · 0.85

Tested by

no test coverage detected