diff options
author | Oleksandr Kravchuk <open.source@oleksandr-kravchuk.com> | 2020-07-16 04:17:38 +0200 |
---|---|---|
committer | Martin Braun <martin@gnuradio.org> | 2020-08-03 11:40:27 +0200 |
commit | a4b7a48f71a059c7410ee3e97aa682361cf22799 (patch) | |
tree | 9530900b05516aae06b6483781a5ebb818f322a0 /grc/core | |
parent | f25a97122d74ce8217efcdec807b4c338627ec06 (diff) |
python: Remove unnecessary 'from __future__ import'
All of the removed `from __future__ import` were needed in older
versions of Python (mostly 2.5.x and below) but later became mandatory
in most versions of Python 3 hence are not necessary anymore.
More specifically, according to __future__.py[1]:
- unicode_literals is part of Python since versions 2.6.0 and 3.0.0;
- print_function is part of Python since versions 2.6.0 and 3.0.0;
- absolute_import is part of Python since versions 2.5.0 and 3.0.0;
- division is part of Python since versions 2.2.0 and 3.0.0;
Get rid of those unnecessary imports to slightly clean up the codebase.
[1] https://github.com/python/cpython/blob/master/Lib/__future__.py
Diffstat (limited to 'grc/core')
34 files changed, 0 insertions, 34 deletions
diff --git a/grc/core/Config.py b/grc/core/Config.py index ff98674b3..df80528a7 100644 --- a/grc/core/Config.py +++ b/grc/core/Config.py @@ -5,7 +5,6 @@ SPDX-License-Identifier: GPL-2.0-or-later """ -from __future__ import absolute_import import os from os.path import expanduser, normpath, expandvars, exists diff --git a/grc/core/Connection.py b/grc/core/Connection.py index 998b09823..f5a466f24 100644 --- a/grc/core/Connection.py +++ b/grc/core/Connection.py @@ -6,7 +6,6 @@ SPDX-License-Identifier: GPL-2.0-or-later """ -from __future__ import absolute_import from .base import Element from .utils.descriptors import lazy_property diff --git a/grc/core/Constants.py b/grc/core/Constants.py index 504b4ec0f..b5b7c270c 100644 --- a/grc/core/Constants.py +++ b/grc/core/Constants.py @@ -6,7 +6,6 @@ SPDX-License-Identifier: GPL-2.0-or-later """ -from __future__ import absolute_import import os import numbers diff --git a/grc/core/FlowGraph.py b/grc/core/FlowGraph.py index b0141f870..93d2f932a 100644 --- a/grc/core/FlowGraph.py +++ b/grc/core/FlowGraph.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import, print_function import collections import itertools diff --git a/grc/core/Messages.py b/grc/core/Messages.py index 23902e57e..ec2221e25 100644 --- a/grc/core/Messages.py +++ b/grc/core/Messages.py @@ -5,7 +5,6 @@ # -from __future__ import absolute_import import traceback import sys diff --git a/grc/core/blocks/__init__.py b/grc/core/blocks/__init__.py index 61f63fa88..815df9f31 100644 --- a/grc/core/blocks/__init__.py +++ b/grc/core/blocks/__init__.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import from ._flags import Flags from ._templates import MakoTemplates diff --git a/grc/core/blocks/_build.py b/grc/core/blocks/_build.py index 151fa3274..690f21390 100644 --- a/grc/core/blocks/_build.py +++ b/grc/core/blocks/_build.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import import itertools import re diff --git a/grc/core/blocks/_flags.py b/grc/core/blocks/_flags.py index ad370c2f3..a1bc7041d 100644 --- a/grc/core/blocks/_flags.py +++ b/grc/core/blocks/_flags.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import import six diff --git a/grc/core/blocks/_templates.py b/grc/core/blocks/_templates.py index fd94bc578..7c84d1dbe 100644 --- a/grc/core/blocks/_templates.py +++ b/grc/core/blocks/_templates.py @@ -8,7 +8,6 @@ This dict class holds a (shared) cache of compiled mako templates. These """ -from __future__ import absolute_import, print_function from mako.template import Template from mako.exceptions import SyntaxException diff --git a/grc/core/blocks/block.py b/grc/core/blocks/block.py index 3dbdfbef1..8cd0e3e92 100644 --- a/grc/core/blocks/block.py +++ b/grc/core/blocks/block.py @@ -6,7 +6,6 @@ SPDX-License-Identifier: GPL-2.0-or-later """ -from __future__ import absolute_import import collections import itertools diff --git a/grc/core/blocks/dummy.py b/grc/core/blocks/dummy.py index 202a30ffd..844507337 100644 --- a/grc/core/blocks/dummy.py +++ b/grc/core/blocks/dummy.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import from . import Block, register_build_in diff --git a/grc/core/blocks/embedded_python.py b/grc/core/blocks/embedded_python.py index fd0cae404..14535fed1 100644 --- a/grc/core/blocks/embedded_python.py +++ b/grc/core/blocks/embedded_python.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import from ast import literal_eval from textwrap import dedent diff --git a/grc/core/blocks/virtual.py b/grc/core/blocks/virtual.py index 598e8371d..18f59f19d 100644 --- a/grc/core/blocks/virtual.py +++ b/grc/core/blocks/virtual.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import import itertools diff --git a/grc/core/cache.py b/grc/core/cache.py index f7a130539..bda84368f 100644 --- a/grc/core/cache.py +++ b/grc/core/cache.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import, print_function, unicode_literals from io import open import json diff --git a/grc/core/errors.py b/grc/core/errors.py index d00aef6a8..675a553ba 100644 --- a/grc/core/errors.py +++ b/grc/core/errors.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import, print_function class GRCError(Exception): diff --git a/grc/core/generator/FlowGraphProxy.py b/grc/core/generator/FlowGraphProxy.py index 0003cb501..9469cc372 100644 --- a/grc/core/generator/FlowGraphProxy.py +++ b/grc/core/generator/FlowGraphProxy.py @@ -5,7 +5,6 @@ # -from __future__ import absolute_import from six.moves import range from ..utils import expr_utils diff --git a/grc/core/generator/Generator.py b/grc/core/generator/Generator.py index 4bc3fd7cb..1063fc8ca 100644 --- a/grc/core/generator/Generator.py +++ b/grc/core/generator/Generator.py @@ -5,7 +5,6 @@ # -from __future__ import absolute_import from .hier_block import HierBlockGenerator, QtHierBlockGenerator from .top_block import TopBlockGenerator diff --git a/grc/core/generator/__init__.py b/grc/core/generator/__init__.py index b64972a62..cab55645b 100644 --- a/grc/core/generator/__init__.py +++ b/grc/core/generator/__init__.py @@ -4,5 +4,4 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import from .Generator import Generator diff --git a/grc/core/io/yaml.py b/grc/core/io/yaml.py index 4e8ca5e65..b10a280c8 100644 --- a/grc/core/io/yaml.py +++ b/grc/core/io/yaml.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import from collections import OrderedDict diff --git a/grc/core/params/dtypes.py b/grc/core/params/dtypes.py index b68f93ff7..434221650 100644 --- a/grc/core/params/dtypes.py +++ b/grc/core/params/dtypes.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import import re diff --git a/grc/core/params/param.py b/grc/core/params/param.py index 2f829926d..7e0f0ce46 100644 --- a/grc/core/params/param.py +++ b/grc/core/params/param.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import import ast import collections diff --git a/grc/core/params/template_arg.py b/grc/core/params/template_arg.py index d7e02ab8f..cb5b1b4a7 100644 --- a/grc/core/params/template_arg.py +++ b/grc/core/params/template_arg.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import class TemplateArg(str): diff --git a/grc/core/platform.py b/grc/core/platform.py index af14c11d2..cbc8a138b 100644 --- a/grc/core/platform.py +++ b/grc/core/platform.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import, print_function from codecs import open from collections import namedtuple diff --git a/grc/core/ports/__init__.py b/grc/core/ports/__init__.py index 5383e70d8..bdbfa5042 100644 --- a/grc/core/ports/__init__.py +++ b/grc/core/ports/__init__.py @@ -6,7 +6,6 @@ SPDX-License-Identifier: GPL-2.0-or-later """ -from __future__ import absolute_import from .port import Port from .clone import PortClone diff --git a/grc/core/ports/_virtual_connections.py b/grc/core/ports/_virtual_connections.py index 02db0058b..a0e7b05a8 100644 --- a/grc/core/ports/_virtual_connections.py +++ b/grc/core/ports/_virtual_connections.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import from itertools import chain diff --git a/grc/core/ports/port.py b/grc/core/ports/port.py index 2d2f25d94..91584c76d 100644 --- a/grc/core/ports/port.py +++ b/grc/core/ports/port.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import from . import _virtual_connections diff --git a/grc/core/schema_checker/validator.py b/grc/core/schema_checker/validator.py index dabc911b5..903cb88b1 100644 --- a/grc/core/schema_checker/validator.py +++ b/grc/core/schema_checker/validator.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import print_function import six diff --git a/grc/core/utils/__init__.py b/grc/core/utils/__init__.py index 00002ed95..56804620a 100644 --- a/grc/core/utils/__init__.py +++ b/grc/core/utils/__init__.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import import six diff --git a/grc/core/utils/backports/__init__.py b/grc/core/utils/backports/__init__.py index 53f54f30b..5302379bc 100644 --- a/grc/core/utils/backports/__init__.py +++ b/grc/core/utils/backports/__init__.py @@ -5,7 +5,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -from __future__ import absolute_import try: from collections import ChainMap diff --git a/grc/core/utils/backports/shlex.py b/grc/core/utils/backports/shlex.py index a4f32ded8..857bb2087 100644 --- a/grc/core/utils/backports/shlex.py +++ b/grc/core/utils/backports/shlex.py @@ -5,7 +5,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later # -from __future__ import absolute_import import re import shlex diff --git a/grc/core/utils/descriptors/evaluated.py b/grc/core/utils/descriptors/evaluated.py index 04925116f..19fa46bba 100644 --- a/grc/core/utils/descriptors/evaluated.py +++ b/grc/core/utils/descriptors/evaluated.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: GPL-2.0-or-later # -from __future__ import absolute_import import six diff --git a/grc/core/utils/epy_block_io.py b/grc/core/utils/epy_block_io.py index 823116adb..1b145d9b9 100644 --- a/grc/core/utils/epy_block_io.py +++ b/grc/core/utils/epy_block_io.py @@ -1,5 +1,4 @@ -from __future__ import absolute_import import inspect import collections diff --git a/grc/core/utils/expr_utils.py b/grc/core/utils/expr_utils.py index e74180221..417e52253 100644 --- a/grc/core/utils/expr_utils.py +++ b/grc/core/utils/expr_utils.py @@ -6,7 +6,6 @@ SPDX-License-Identifier: GPL-2.0-or-later """ -from __future__ import absolute_import, print_function import string diff --git a/grc/core/utils/extract_docs.py b/grc/core/utils/extract_docs.py index 2be49e732..8389c29e8 100644 --- a/grc/core/utils/extract_docs.py +++ b/grc/core/utils/extract_docs.py @@ -6,7 +6,6 @@ SPDX-License-Identifier: GPL-2.0-or-later """ -from __future__ import absolute_import, print_function import sys import re |