aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/signature/signature_extend.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/libshiboken/signature/signature_extend.cpp')
-rw-r--r--sources/shiboken2/libshiboken/signature/signature_extend.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/sources/shiboken2/libshiboken/signature/signature_extend.cpp b/sources/shiboken2/libshiboken/signature/signature_extend.cpp
index 1490a6003..c1918c492 100644
--- a/sources/shiboken2/libshiboken/signature/signature_extend.cpp
+++ b/sources/shiboken2/libshiboken/signature/signature_extend.cpp
@@ -157,25 +157,25 @@ static PyObject *handle_doc(PyObject *ob, PyObject *old_descr)
init_module_2();
AutoDecRef ob_type_mod(GetClassOrModOf(ob));
const char *name;
- if (PyModule_Check(ob_type_mod))
- name = PyModule_GetName(ob_type_mod);
+ if (PyModule_Check(ob_type_mod.object()))
+ name = PyModule_GetName(ob_type_mod.object());
else
name = reinterpret_cast<PyTypeObject *>(ob_type_mod.object())->tp_name;
- if (handle_doc_in_progress || name == nullptr
- || strncmp(name, "PySide2.", 8) != 0)
- return PyObject_CallMethodObjArgs(old_descr,
- PyMagicName::get(),
- ob, nullptr);
- handle_doc_in_progress++;
- PyObject *res = PyObject_CallFunction(
- pyside_globals->make_helptext_func,
- const_cast<char *>("(O)"), ob);
- handle_doc_in_progress--;
- if (res == nullptr) {
- PyErr_Print();
- Py_FatalError("handle_doc did not receive a result");
+ PyObject *res{};
+
+ if (handle_doc_in_progress || name == nullptr || strncmp(name, "PySide2.", 8) != 0) {
+ res = PyObject_CallMethodObjArgs(old_descr, PyMagicName::get(), ob, nullptr);
+ } else {
+ handle_doc_in_progress++;
+ res = PyObject_CallFunction(pyside_globals->make_helptext_func, "(O)", ob);
+ handle_doc_in_progress--;
}
- return res;
+
+ if (res)
+ return res;
+
+ PyErr_Clear();
+ Py_RETURN_NONE;
}
static PyObject *pyside_cf_get___doc__(PyObject *cf)