Commit 2455093
committed
Fix: Suppress AttributeError tracebacks during widget teardown on Python 3.14 / Qt6
During widget destruction, Qt still delivers events and calls size-hint
methods on QwtPlot objects whose Python __dict__ has already been cleared,
so accessing private instance attributes raises an uncaught AttributeError.
This produced noisy "Unhandled exception" tracebacks at pytest teardown for
several subclasses (BasePlot, LevelsHistogram, XCrossSectionPlot,
YCrossSectionPlot), reporting 'object has no attribute _QwtPlot__data'.
* [FIX] : Guard access to self.__data.canvas in QwtPlot.eventFilter with
try/except AttributeError, delegating to QFrame.eventFilter on failure
* [FIX] : Guard access to self.__data.layout in QwtPlot.minimumSizeHint
with try/except AttributeError, returning an empty QSize() on failure1 parent 64a9401 commit 2455093
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1007 | 1007 | | |
1008 | 1008 | | |
1009 | 1009 | | |
1010 | | - | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
1011 | 1016 | | |
1012 | 1017 | | |
1013 | 1018 | | |
| |||
1195 | 1200 | | |
1196 | 1201 | | |
1197 | 1202 | | |
1198 | | - | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
1199 | 1209 | | |
1200 | 1210 | | |
1201 | 1211 | | |
| |||
0 commit comments