Repository navigation
SWR matplotlib__matplotlib-9169 - #151
richeshgupta wants to merge 2 commits into
Conversation
| except AttributeError: | ||
| pass | ||
| # Restore __init__ | ||
| QtWidgets.QWidget.__init__ = qwidget_init |
There was a problem hiding this comment.
[MEDIUM] No test covers the new QWidget.init restoration or the bytes QApplication argument
Issue
The old code swallowed the AttributeError from del QtWidgets.QWidget.__init__, leaving the monkeypatched cooperative_qwidget_init installed on QWidget for the life of the process, and this diff fixes that. No test can fail on the pre-fix code because the leaked wrapper is a transparent passthrough, and the bytes argv change in _create_qApp is likewise exercised by no test in this diff.
Evidence
SUSPECTED: A test in lib/matplotlib/tests/test_backend_qt5.py that creates a qt5 figure with no pre-existing QApplication, then asserts QtWidgets.QWidget.__init__ is no longer cooperative_qwidget_init, would fail on the pre-fix code and would also pin the bytes argv.
SWRBench case matplotlib__matplotlib-9169: pinned base d02024e to head 52eb8b8 of matplotlib#9169. Benchmark replay, not for merge.