Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: remove more six crumbs #3675

Merged
merged 2 commits into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading