Skip to content

Commit

Permalink
python: remove more six crumbs (#3675)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-detiste authored Apr 29, 2024
1 parent b2992f7 commit 5cb708e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
5 changes: 2 additions & 3 deletions gui/wxpython/gmodeler/panels.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import stat
import tempfile
import random
import six
import math

import wx
Expand Down Expand Up @@ -1227,7 +1226,7 @@ def OnModelProperties(self, event):
dlg.Init(properties)
if dlg.ShowModal() == wx.ID_OK:
self.ModelChanged()
for key, value in six.iteritems(dlg.GetValues()):
for key, value in dlg.GetValues().items():
properties[key] = value
for action in self.model.GetItems(objType=ModelAction):
action.GetTask().set_flag("overwrite", properties["overwrite"])
Expand Down Expand Up @@ -1459,7 +1458,7 @@ def OnAdd(self, event):
def UpdateModelVariables(self):
"""Update model variables"""
variables = dict()
for values in six.itervalues(self.list.GetData()):
for values in self.list.GetData().values():
name = values[0]
variables[name] = {"type": str(values[1])}
if values[2]:
Expand Down
16 changes: 1 addition & 15 deletions python/grass/pygrass/modules/interface/testsuite/test_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,6 @@
]


# taken from six
def with_metaclass(meta, *bases):
"""Create a base class with a metaclass."""

# This requires a bit of explanation: the basic idea is to make a dummy
# metaclass for one level of class instantiation that replaces itself with
# the actual metaclass.
class metaclass(meta):
def __new__(cls, name, this_bases, d):
return meta(name, bases, d)

return type.__new__(metaclass, "temporary_class", (), {})


class ModulesMeta(type):
def __new__(mcs, name, bases, dict):
def gen_test(cmd):
Expand All @@ -53,7 +39,7 @@ def test(self):
return type.__new__(mcs, name, bases, dict)


class TestModules(with_metaclass(ModulesMeta, TestCase)):
class TestModules(TestCase, metaclass=ModulesMeta):
pass


Expand Down

0 comments on commit 5cb708e

Please sign in to comment.