Remove unnecessary imports.

This commit is contained in:
Itamar Turner-Trauring 2024-02-27 15:37:53 -05:00
parent b2541be7c6
commit 3fb0bcfff7
18 changed files with 15 additions and 22 deletions

View File

@ -6,7 +6,6 @@ Ported to Python 3.
from future.utils import PY2
from warnings import catch_warnings
def patch():

View File

@ -6,7 +6,7 @@ Ported to Python 3.
Note that for RemoteInterfaces, the __remote_name__ needs to be a native string because of https://github.com/warner/foolscap/blob/43f4485a42c9c28e2c79d655b3a9e24d4e6360ca/src/foolscap/remoteinterface.py#L67
"""
from future.utils import PY2, native_str
from future.utils import native_str
from past.builtins import long
from typing import Dict

View File

@ -3,7 +3,7 @@ Ported to Python 3.
"""
from future.utils import PY2, native_str
from future.utils import native_str
from zope.interface import Interface
from foolscap.api import StringConstraint, SetOf, DictOf, Any, \

View File

@ -1,6 +1,5 @@
import os, sys
from io import StringIO
from past.builtins import unicode
import six
from twisted.python import usage
@ -106,7 +105,7 @@ def parse_options(argv, config=None):
config = Options()
try:
config.parseOptions(argv)
except usage.error as e:
except usage.error:
raise
return config

View File

@ -2,7 +2,7 @@
Ported to Python 3.
"""
from future.utils import PY2, PY3
from future.utils import PY3
from six import ensure_str

View File

@ -2,7 +2,7 @@
Ported to Python 3.
"""
from future.utils import PY2, PY3
from future.utils import PY3
from urllib.parse import quote as url_quote
from allmydata.scripts.common import get_alias, DEFAULT_ALIAS, escape_path, \

View File

@ -2,7 +2,7 @@
Ported to Python 3.
"""
from future.utils import PY2, PY3
from future.utils import PY3
from six import ensure_str

View File

@ -2,7 +2,7 @@
Ported to Python 3.
"""
from future.utils import PY2, PY3
from future.utils import PY3
import os.path
from allmydata.util import base32

View File

@ -3,7 +3,7 @@ Ported to Python 3.
"""
from future.utils import PY2, bytes_to_native_str
from future.utils import bytes_to_native_str
import os, stat, struct, time

View File

@ -14,7 +14,7 @@ from twisted.python.monkey import MonkeyPatcher
from allmydata.util import fileutil
from allmydata.util.fileutil import abspath_expanduser_unicode
from allmydata.util.encodingutil import get_io_encoding, unicode_to_argv
from allmydata.util.encodingutil import unicode_to_argv
from allmydata.util.namespace import Namespace
from allmydata.scripts import cli, backupdb
from ..common_util import StallMixin

View File

@ -9,8 +9,7 @@ from twisted.internet import defer
from allmydata.scripts import cli
from allmydata.util import fileutil
from allmydata.util.encodingutil import (quote_output, get_io_encoding,
unicode_to_output, to_bytes)
from allmydata.util.encodingutil import (quote_output, unicode_to_output, to_bytes)
from allmydata.util.assertutil import _assert
from ..no_network import GridTestMixin
from .common import CLITestMixin

View File

@ -2,7 +2,7 @@
Ported to Python 3.
"""
from future.utils import PY2, PY3
from future.utils import PY3
from six import ensure_str
from twisted.trial import unittest

View File

@ -2,7 +2,7 @@
Ported to Python 3.
"""
from future.utils import PY2, bchr
from future.utils import bchr
from past.builtins import long

View File

@ -5,7 +5,7 @@ Ported to Python 3.
"""
from future.utils import PY2, PY3
from future.utils import PY3
import time
import os.path

View File

@ -5,7 +5,7 @@ Ported to Python 3.
"""
from future.utils import PY2, native_str
from future.utils import native_str
from twisted.trial import unittest
from twisted.python.failure import Failure

View File

@ -46,9 +46,6 @@ from allmydata.util.pid import (
)
from allmydata.test import common_util
import allmydata
from allmydata.scripts.runner import (
parse_options,
)
from allmydata.scripts.tahoe_run import (
on_stdin_close,
)

View File

@ -8,7 +8,7 @@ Once Python 2 support is dropped, most of this module will obsolete, since
Unicode is the default everywhere in Python 3.
"""
from future.utils import PY2, PY3, native_str
from future.utils import PY3, native_str
from future.builtins import str as future_str
from past.builtins import unicode

View File

@ -5,7 +5,6 @@ Ported to Python 3.
"""
import json
import codecs
def bytes_to_unicode(any_bytes, obj):