Draft: change super() so it is compatible with Python 2
In Python 3 `super()` can be used without an argument in order to get the parent class, `super()`. In Python 2 the present class must be used as an argument, `super(ThisClass, self)`. This commit is done to support Python 2, as without it all Gui Command tools will be broken and will fail to launch, even if the unit tests pass. Also, set the `__metaclass__` variable to `type`. This is done to turn all classes into "new style" classes in Python 2. This is required so `super()` works correctly in this version of Pyton. This commit can be reverted once Python 2 support is completely dropped, and only Python 3 compatible code is used.
This commit is contained in:
@@ -71,7 +71,7 @@ class PointArray(gui_base_original.Modifier):
|
||||
|
||||
def Activated(self):
|
||||
"""Execute when the command is called."""
|
||||
super().Activated(name=_tr("Point array"))
|
||||
super(PointArray, self).Activated(name=_tr("Point array"))
|
||||
if not Gui.Selection.getSelectionEx():
|
||||
if self.ui:
|
||||
self.ui.selectUi()
|
||||
|
||||
Reference in New Issue
Block a user