Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb6fa1d

Browse files
committed
Makes restore __init__ works with PySide
1 parent d02024e commit fb6fa1d

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

lib/matplotlib/backends/backend_qt5.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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)