| 9 | namespace detail |
| 10 | { |
| 11 | override wrapper_base::get_override( |
| 12 | char const* name |
| 13 | , PyTypeObject* class_object |
| 14 | ) const |
| 15 | { |
| 16 | if (this->m_self) |
| 17 | { |
| 18 | if (handle<> m = handle<>( |
| 19 | python::allow_null( |
| 20 | ::PyObject_GetAttrString( |
| 21 | this->m_self, const_cast<char*>(name)))) |
| 22 | ) |
| 23 | { |
| 24 | PyObject* borrowed_f = 0; |
| 25 | |
| 26 | if ( |
| 27 | PyMethod_Check(m.get()) |
| 28 | && ((PyMethodObject*)m.get())->im_self == this->m_self |
| 29 | && class_object->tp_dict != 0 |
| 30 | ) |
| 31 | { |
| 32 | borrowed_f = ::PyDict_GetItemString( |
| 33 | class_object->tp_dict, const_cast<char*>(name)); |
| 34 | |
| 35 | |
| 36 | } |
| 37 | if (borrowed_f != ((PyMethodObject*)m.get())->im_func) |
| 38 | return override(m); |
| 39 | } |
| 40 | } |
| 41 | return override(handle<>(detail::none())); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | #if 0 |