| 959 | |
| 960 | PYBIND11_NAMESPACE_BEGIN(detail) |
| 961 | inline handle get_function(handle value) { |
| 962 | if (value) { |
| 963 | if (PyInstanceMethod_Check(value.ptr())) { |
| 964 | value = PyInstanceMethod_GET_FUNCTION(value.ptr()); |
| 965 | } else if (PyMethod_Check(value.ptr())) { |
| 966 | value = PyMethod_GET_FUNCTION(value.ptr()); |
| 967 | } |
| 968 | } |
| 969 | return value; |
| 970 | } |
| 971 | |
| 972 | // Reimplementation of python's dict helper functions to ensure that exceptions |
| 973 | // aren't swallowed (see #2862) |
no test coverage detected