@@ -16,9 +16,11 @@ naturally in your python code::
16
16
print('mouse released at: %s' % ev.pos())
17
17
18
18
This works fine, but if python code in Qt virtual methods raise an exception
19
- ``PyQt `` and ``PySide `` will just print the exception traceback to standard
19
+ ``PyQt4 `` and ``PySide `` will just print the exception traceback to standard
20
20
error, since this method is called deep within Qt's even loop handling and
21
- exceptions are not allowed at that point.
21
+ exceptions are not allowed at that point. In ``PyQt5.5+ ``, exceptions in
22
+ virtual methods will by default call ``abort() ``, which will crash the
23
+ interpreter.
22
24
23
25
This might be surprising for python users which are used to exceptions
24
26
being raised at the calling point: for example, the following code will just
@@ -61,4 +63,12 @@ Or even disable it for your entire project in your ``pytest.ini`` file:
61
63
[pytest]
62
64
qt_no_exception_capture = 1
63
65
64
- This might be desirable if you plan to install a custom exception hook.
66
+ This might be desirable if you plan to install a custom exception hook.
67
+
68
+
69
+ .. note ::
70
+
71
+ Starting with ``PyQt5.5 ``, exceptions raised during virtual methods will
72
+ actually trigger an ``abort() ``, crashing the Python interpreter. For this
73
+ reason, disabling exception capture in ``PyQt5.5+ `` is not recommended
74
+ unless you install your own exception hook.
0 commit comments