aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sources/pyside6/tests/QtCore/errormessages_with_features_test.py10
-rw-r--r--sources/shiboken6/libshiboken/signature/signature_extend.cpp6
-rw-r--r--sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py2
3 files changed, 13 insertions, 5 deletions
diff --git a/sources/pyside6/tests/QtCore/errormessages_with_features_test.py b/sources/pyside6/tests/QtCore/errormessages_with_features_test.py
index 72452a588..4a515c800 100644
--- a/sources/pyside6/tests/QtCore/errormessages_with_features_test.py
+++ b/sources/pyside6/tests/QtCore/errormessages_with_features_test.py
@@ -46,9 +46,12 @@ sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
+from PySide6 import QtCore
from PySide6.QtWidgets import QApplication, QLabel
from PySide6.support import __feature__
+import inspect
+
"""
errormessages_with_features_test.py
-----------------------------------
@@ -120,6 +123,13 @@ class ErrormessagesWithFeatures(unittest.TestCase):
qApp.quit_on_last_window_closed = object
self.assertTrue(self.probe_miss in cm.exception.args[0])
+ def testDocIsWorking(self):
+ """
+ make sure that it does not crash when touched
+ """
+ inspect.getdoc(QApplication)
+ inspect.getdoc(QtCore)
+
if __name__ == '__main__':
unittest.main()
diff --git a/sources/shiboken6/libshiboken/signature/signature_extend.cpp b/sources/shiboken6/libshiboken/signature/signature_extend.cpp
index 4b67d778f..c7aedef08 100644
--- a/sources/shiboken6/libshiboken/signature/signature_extend.cpp
+++ b/sources/shiboken6/libshiboken/signature/signature_extend.cpp
@@ -173,10 +173,8 @@ static PyObject *handle_doc(PyObject *ob, PyObject *old_descr)
pyside_globals->make_helptext_func,
"(O)", ob);
handle_doc_in_progress--;
- if (res == nullptr) {
- PyErr_Print();
- Py_FatalError("handle_doc did not receive a result");
- }
+ if (res == nullptr)
+ PyErr_Format(PyExc_AttributeError, "%R object has no `__doc__` attribute", ob);
return res;
}
diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py
index 4c436eafd..6cab8746f 100644
--- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py
+++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/errorhandler.py
@@ -156,7 +156,7 @@ def check_string_type(s):
def make_helptext(func):
- existing_doc = func.__doc__
+ existing_doc = func.__doc__ if hasattr(func, "__doc__") else None
sigs = get_signature(func)
if not sigs:
return existing_doc