| 17 | PYBIND11_NAMESPACE_BEGIN(detail) |
| 18 | |
| 19 | inline 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 | |
| 32 | PYBIND11_NAMESPACE_END(detail) |
| 33 |
no test coverage detected