summaryrefslogtreecommitdiff
path: root/gr-utils/python
diff options
context:
space:
mode:
Diffstat (limited to 'gr-utils/python')
-rw-r--r--gr-utils/python/modtool/cli/base.py2
-rw-r--r--gr-utils/python/modtool/core/base.py17
-rw-r--r--gr-utils/python/modtool/tests/test_modtool.py6
3 files changed, 2 insertions, 23 deletions
diff --git a/gr-utils/python/modtool/cli/base.py b/gr-utils/python/modtool/cli/base.py
index 5fa2b8b7b4..d0259372ff 100644
--- a/gr-utils/python/modtool/cli/base.py
+++ b/gr-utils/python/modtool/cli/base.py
@@ -73,8 +73,6 @@ class CommandCLI(click.Group):
command is the priority over the same external plug-in command.
"""
try:
- if sys.version_info[0] == 2:
- cmd_name = cmd_name.encode('ascii', 'replace')
mod = import_module('gnuradio.modtool.cli.' + cmd_name)
except ImportError:
return self.commands.get(cmd_name)
diff --git a/gr-utils/python/modtool/core/base.py b/gr-utils/python/modtool/core/base.py
index 55b6f48076..d9f6a3b6e2 100644
--- a/gr-utils/python/modtool/core/base.py
+++ b/gr-utils/python/modtool/core/base.py
@@ -30,22 +30,7 @@ import glob
import logging
import itertools
-try:
- from types import SimpleNamespace
-except:
- # Py2.7 doesn't have SimpleNamespace, soooo use what Py3 docs say is roughly equivalent
- class SimpleNamespace:
- def __init__(self, **kwargs):
- self.__dict__.update(kwargs)
-
- def __repr__(self):
- keys = sorted(self.__dict__)
- items = ("{}={!r}".format(k, self.__dict__[k]) for k in keys)
- return "{}({})".format(type(self).__name__, ", ".join(items))
-
- def __eq__(self, other):
- return self.__dict__ == other.__dict__
-
+from types import SimpleNamespace
from gnuradio import gr
from ..tools import get_modname, SCMRepoFactory
diff --git a/gr-utils/python/modtool/tests/test_modtool.py b/gr-utils/python/modtool/tests/test_modtool.py
index 957a5e7d54..3cfd735f90 100644
--- a/gr-utils/python/modtool/tests/test_modtool.py
+++ b/gr-utils/python/modtool/tests/test_modtool.py
@@ -64,11 +64,7 @@ class TestModToolCore(unittest.TestCase):
def setUp(self):
""" create a new module and block before every test """
try:
- try:
- warnings.simplefilter("ignore", ResourceWarning)
- except (NameError):
- # Python2 , Python3 < 3.2 don't know ResourceWarning
- pass
+ warnings.simplefilter("ignore", ResourceWarning)
args = {'module_name':'howto',
'directory': self.test_dir,
'srcdir': self.srcdir}