Skip to content

Commit 4b50e49

Browse files
authored
Merge pull request matplotlib#9169 from t20100/fix-restore-init-pyside
Fix matplotlib corrupting PySide
2 parents f945eca + 52eb8b8 commit 4b50e49

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/matplotlib/backends/backend_qt5.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _create_qApp():
121121
if display is None or not re.search(r':\d', display):
122122
raise RuntimeError('Invalid DISPLAY variable')
123123

124-
qApp = QtWidgets.QApplication(["matplotlib"])
124+
qApp = QtWidgets.QApplication([b"matplotlib"])
125125
qApp.lastWindowClosed.connect(qApp.quit)
126126
else:
127127
qApp = app
@@ -170,11 +170,8 @@ def wrapper(self, **kwargs):
170170
QtWidgets.QWidget.__init__ = cooperative_qwidget_init
171171
__init__(self, **kwargs)
172172
finally:
173-
try:
174-
# Restore __init__ to sip.simplewrapper.__init__.
175-
del QtWidgets.QWidget.__init__
176-
except AttributeError:
177-
pass
173+
# Restore __init__
174+
QtWidgets.QWidget.__init__ = qwidget_init
178175

179176
return wrapper
180177

0 commit comments

Comments
 (0)