Skip to content

Commit 1d40965

Browse files
committed
Don't use super without args because it's not supported in Python 2
Fixes spyder-ide#2235
1 parent 6bbd031 commit 1d40965

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

spyderlib/plugins/__init__.py

+4-7
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,9 @@ class SpyderPluginMixin(object):
158158
show_message = None
159159
update_plugin_title = None
160160

161-
def __init__(self, main = None, **kwds):
161+
def __init__(self, main=None, **kwds):
162162
"""Bind widget to a QMainWindow instance"""
163-
if PYQT5:
164-
super().__init__(**kwds)
165-
else:
166-
super(SpyderPluginMixin, self).__init__()
163+
super(SpyderPluginMixin, self).__init__(**kwds)
167164
assert self.CONF_SECTION is not None
168165
self.main = main
169166
self.default_margins = None
@@ -422,8 +419,8 @@ class SpyderPluginWidget(QWidget, SpyderPluginMixin):
422419

423420
if PYQT5:
424421
def __init__(self, parent, **kwds):
425-
super().__init__(**kwds)
426-
else:
422+
super(SpyderPluginWidget, self).__init__(parent, **kwds)
423+
else:
427424
def __init__(self, parent):
428425
QWidget.__init__(self, parent)
429426
SpyderPluginMixin.__init__(self, parent)

spyderlib/plugins/workingdirectory.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class WorkingDirectory(QToolBar, SpyderPluginMixin):
152152

153153
def __init__(self, parent, workdir=None, **kwds):
154154
if PYQT5:
155-
super().__init__(**kwds)
155+
super(WorkingDirectory, self).__init__(parent, **kwds)
156156
else:
157157
QToolBar.__init__(self, parent)
158158
SpyderPluginMixin.__init__(self, parent)

0 commit comments

Comments
 (0)