aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2020-07-22 17:34:59 -0700
committerZac Medico <zmedico@gentoo.org>2020-07-22 19:59:00 -0700
commitbe20b37180f709ab0e451e4e07b6e82ac3a87b56 (patch)
tree7a2ce667c62a402d554b1e96f68b21ba1992735d
parent_EbuildFetcherProcess: emit eerror for fetch failure in _proc_join_done (diff)
downloadportage-be20b37180f709ab0e451e4e07b6e82ac3a87b56.tar.gz
portage-be20b37180f709ab0e451e4e07b6e82ac3a87b56.tar.bz2
portage-be20b37180f709ab0e451e4e07b6e82ac3a87b56.zip
Fix 'unused-import' for stdlib imports.
This is part of a cleanup to enable pylint. This is only stdlib modules; there are hundreds of unused imports of other modules but its less clear how safe those are to remove due to side effects. Signed-off-by: Alec Warner <antarus@gentoo.org> Change-Id: If9bee83bbbe1620b34a0f8d153637909af2b8512 Closes: https://github.com/gentoo/portage/pull/585 Signed-off-by: Zac Medico <zmedico@gentoo.org>
-rw-r--r--lib/_emerge/AbstractPollTask.py1
-rw-r--r--lib/_emerge/BlockerCache.py1
-rw-r--r--lib/_emerge/BlockerDB.py1
-rw-r--r--lib/_emerge/DependencyArg.py1
-rw-r--r--lib/_emerge/FakeVartree.py1
-rw-r--r--lib/_emerge/FifoIpcDaemon.py1
-rw-r--r--lib/_emerge/Package.py2
-rw-r--r--lib/_emerge/PackageVirtualDbapi.py1
-rw-r--r--lib/_emerge/PipeReader.py1
-rw-r--r--lib/_emerge/SequentialTaskQueue.py1
-rw-r--r--lib/_emerge/TaskSequence.py1
-rw-r--r--lib/_emerge/UseFlagDisplay.py1
-rw-r--r--lib/_emerge/actions.py4
-rw-r--r--lib/_emerge/create_world_atom.py1
-rw-r--r--lib/_emerge/depgraph.py1
-rw-r--r--lib/_emerge/emergelog.py1
-rw-r--r--lib/_emerge/resolver/DbapiProvidesIndex.py1
-rw-r--r--lib/_emerge/resolver/output.py1
-rw-r--r--lib/_emerge/resolver/output_helpers.py1
-rw-r--r--lib/_emerge/resolver/slot_collision.py1
-rw-r--r--lib/portage/_emirrordist/Config.py1
-rw-r--r--lib/portage/_emirrordist/FetchTask.py2
-rw-r--r--lib/portage/_emirrordist/MirrorDistTask.py1
-rw-r--r--lib/portage/_selinux.py1
-rw-r--r--lib/portage/_sets/base.py1
-rw-r--r--lib/portage/cache/anydbm.py1
-rw-r--r--lib/portage/cache/flat_hash.py1
-rw-r--r--lib/portage/cache/fs_template.py1
-rw-r--r--lib/portage/cache/index/pkg_desc_index.py1
-rw-r--r--lib/portage/cache/mappings.py1
-rw-r--r--lib/portage/cache/metadata.py1
-rw-r--r--lib/portage/cache/sql_template.py1
-rw-r--r--lib/portage/cache/sqlite.py1
-rw-r--r--lib/portage/cache/template.py1
-rw-r--r--lib/portage/checksum.py1
-rw-r--r--lib/portage/cvstree.py1
-rw-r--r--lib/portage/data.py5
-rw-r--r--lib/portage/dbapi/bintree.py1
-rw-r--r--lib/portage/dbapi/porttree.py1
-rw-r--r--lib/portage/dbapi/vartree.py1
-rw-r--r--lib/portage/dep/soname/SonameAtom.py1
-rw-r--r--lib/portage/eclass_cache.py1
-rw-r--r--lib/portage/elog/mod_save_summary.py1
-rw-r--r--lib/portage/elog/mod_syslog.py1
-rw-r--r--lib/portage/emaint/modules/binhost/binhost.py1
-rw-r--r--lib/portage/emaint/modules/sync/sync.py2
-rw-r--r--lib/portage/exception.py1
-rw-r--r--lib/portage/manifest.py1
-rw-r--r--lib/portage/package/ebuild/getmaskingstatus.py1
-rw-r--r--lib/portage/proxy/objectproxy.py1
-rw-r--r--lib/portage/repository/config.py1
-rw-r--r--lib/portage/sync/getaddrinfo_validate.py1
-rw-r--r--lib/portage/sync/modules/rsync/rsync.py1
-rw-r--r--lib/portage/tests/dep/test_match_from_list.py1
-rw-r--r--lib/portage/tests/dep/test_soname_atom_pickle.py1
-rw-r--r--lib/portage/tests/ebuild/test_spawn.py1
-rw-r--r--lib/portage/tests/lint/test_bash_syntax.py1
-rw-r--r--lib/portage/tests/process/test_poll.py1
-rw-r--r--lib/portage/tests/resolver/ResolverPlayground.py1
-rw-r--r--lib/portage/tests/sync/test_sync_local.py1
-rw-r--r--lib/portage/tests/unicode/test_string_format.py1
-rw-r--r--lib/portage/tests/util/futures/asyncio/test_pipe_closed.py1
-rw-r--r--lib/portage/tests/util/futures/asyncio/test_subprocess_exec.py1
-rw-r--r--lib/portage/tests/util/futures/test_retry.py1
-rw-r--r--lib/portage/tests/util/test_socks5.py2
-rw-r--r--lib/portage/util/_async/PipeLogger.py1
-rw-r--r--lib/portage/util/_compare_files.py1
-rw-r--r--lib/portage/util/_desktop_entry.py1
-rw-r--r--lib/portage/util/_dyn_libs/LinkageMapELF.py1
-rw-r--r--lib/portage/util/_dyn_libs/NeededEntry.py1
-rw-r--r--lib/portage/util/_dyn_libs/PreservedLibsRegistry.py1
-rw-r--r--lib/portage/util/_eventloop/EventLoop.py1
-rw-r--r--lib/portage/util/_eventloop/global_event_loop.py1
-rw-r--r--lib/portage/util/_urlopen.py1
-rw-r--r--lib/portage/util/compression_probe.py1
-rw-r--r--lib/portage/util/configparser.py1
-rw-r--r--lib/portage/util/digraph.py1
-rw-r--r--lib/portage/util/env_update.py1
-rw-r--r--lib/portage/util/install_mask.py2
-rw-r--r--lib/portage/util/listdir.py1
-rw-r--r--lib/portage/util/movefile.py1
-rw-r--r--lib/portage/util/mtimedb.py1
-rw-r--r--lib/portage/util/whirlpool.py1
-rw-r--r--lib/portage/versions.py1
-rw-r--r--lib/portage/xml/metadata.py1
-rw-r--r--lib/portage/xpak.py1
86 files changed, 4 insertions, 94 deletions
diff --git a/lib/_emerge/AbstractPollTask.py b/lib/_emerge/AbstractPollTask.py
index 7e9f2b536..661b81616 100644
--- a/lib/_emerge/AbstractPollTask.py
+++ b/lib/_emerge/AbstractPollTask.py
@@ -3,7 +3,6 @@
import array
import errno
-import logging
import os
from portage.util import writemsg_level
diff --git a/lib/_emerge/BlockerCache.py b/lib/_emerge/BlockerCache.py
index 9fa3a0d95..008cbd0a8 100644
--- a/lib/_emerge/BlockerCache.py
+++ b/lib/_emerge/BlockerCache.py
@@ -2,7 +2,6 @@
# Distributed under the terms of the GNU General Public License v2
import errno
-import sys
from portage.util import writemsg
from portage.data import secpass
import portage
diff --git a/lib/_emerge/BlockerDB.py b/lib/_emerge/BlockerDB.py
index 356f25bee..7e1f88615 100644
--- a/lib/_emerge/BlockerDB.py
+++ b/lib/_emerge/BlockerDB.py
@@ -1,7 +1,6 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
import portage
from portage import os
diff --git a/lib/_emerge/DependencyArg.py b/lib/_emerge/DependencyArg.py
index 4bb24d0ef..f7ac879ec 100644
--- a/lib/_emerge/DependencyArg.py
+++ b/lib/_emerge/DependencyArg.py
@@ -1,7 +1,6 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
from portage import _encodings, _unicode_encode
diff --git a/lib/_emerge/FakeVartree.py b/lib/_emerge/FakeVartree.py
index b993cdb0d..37349bcdd 100644
--- a/lib/_emerge/FakeVartree.py
+++ b/lib/_emerge/FakeVartree.py
@@ -1,7 +1,6 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
import warnings
import portage
diff --git a/lib/_emerge/FifoIpcDaemon.py b/lib/_emerge/FifoIpcDaemon.py
index ab1fdb572..a21e94db6 100644
--- a/lib/_emerge/FifoIpcDaemon.py
+++ b/lib/_emerge/FifoIpcDaemon.py
@@ -1,7 +1,6 @@
# Copyright 2010-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
from portage import os
from _emerge.AbstractPollTask import AbstractPollTask
diff --git a/lib/_emerge/Package.py b/lib/_emerge/Package.py
index a7ce39719..bf75fd97f 100644
--- a/lib/_emerge/Package.py
+++ b/lib/_emerge/Package.py
@@ -1,8 +1,6 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import functools
-import sys
from itertools import chain
import warnings
diff --git a/lib/_emerge/PackageVirtualDbapi.py b/lib/_emerge/PackageVirtualDbapi.py
index a0905cce8..2070dd9be 100644
--- a/lib/_emerge/PackageVirtualDbapi.py
+++ b/lib/_emerge/PackageVirtualDbapi.py
@@ -1,7 +1,6 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
from portage.dbapi import dbapi
from portage.dbapi.dep_expand import dep_expand
diff --git a/lib/_emerge/PipeReader.py b/lib/_emerge/PipeReader.py
index 90a31679e..4139fbae2 100644
--- a/lib/_emerge/PipeReader.py
+++ b/lib/_emerge/PipeReader.py
@@ -2,7 +2,6 @@
# Distributed under the terms of the GNU General Public License v2
import fcntl
-import sys
from portage import os
from _emerge.AbstractPollTask import AbstractPollTask
diff --git a/lib/_emerge/SequentialTaskQueue.py b/lib/_emerge/SequentialTaskQueue.py
index 1cadbca41..40590b76c 100644
--- a/lib/_emerge/SequentialTaskQueue.py
+++ b/lib/_emerge/SequentialTaskQueue.py
@@ -2,7 +2,6 @@
# Distributed under the terms of the GNU General Public License v2
from collections import deque
-import sys
from portage.util.futures import asyncio
from portage.util.futures.compat_coroutine import coroutine
diff --git a/lib/_emerge/TaskSequence.py b/lib/_emerge/TaskSequence.py
index d6816719f..8d1b0b859 100644
--- a/lib/_emerge/TaskSequence.py
+++ b/lib/_emerge/TaskSequence.py
@@ -1,7 +1,6 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
from collections import deque
from portage import os
diff --git a/lib/_emerge/UseFlagDisplay.py b/lib/_emerge/UseFlagDisplay.py
index 61358cf7b..9496693c8 100644
--- a/lib/_emerge/UseFlagDisplay.py
+++ b/lib/_emerge/UseFlagDisplay.py
@@ -3,7 +3,6 @@
import collections
from itertools import chain
-import sys
from portage import _encodings, _unicode_encode
from portage.output import red
diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index bbd21f5a2..964dca31c 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -8,12 +8,8 @@ import errno
import logging
import operator
import platform
-import pwd
-import random
import re
import signal
-import socket
-import stat
import subprocess
import sys
import tempfile
diff --git a/lib/_emerge/create_world_atom.py b/lib/_emerge/create_world_atom.py
index c4b8ccb69..9d08b6af8 100644
--- a/lib/_emerge/create_world_atom.py
+++ b/lib/_emerge/create_world_atom.py
@@ -1,7 +1,6 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
from portage.dep import Atom, _repo_separator
from portage.exception import InvalidData
diff --git a/lib/_emerge/depgraph.py b/lib/_emerge/depgraph.py
index 127dbe88f..653348d34 100644
--- a/lib/_emerge/depgraph.py
+++ b/lib/_emerge/depgraph.py
@@ -9,7 +9,6 @@ import functools
import io
import logging
import stat
-import sys
import textwrap
import warnings
from collections import deque, OrderedDict
diff --git a/lib/_emerge/emergelog.py b/lib/_emerge/emergelog.py
index be4ccfe35..2c429d6de 100644
--- a/lib/_emerge/emergelog.py
+++ b/lib/_emerge/emergelog.py
@@ -2,7 +2,6 @@
# Distributed under the terms of the GNU General Public License v2
import io
-import sys
import time
import portage
from portage import os
diff --git a/lib/_emerge/resolver/DbapiProvidesIndex.py b/lib/_emerge/resolver/DbapiProvidesIndex.py
index 5a71d9e11..8c7c05f06 100644
--- a/lib/_emerge/resolver/DbapiProvidesIndex.py
+++ b/lib/_emerge/resolver/DbapiProvidesIndex.py
@@ -3,7 +3,6 @@
import bisect
import collections
-import sys
class DbapiProvidesIndex:
"""
diff --git a/lib/_emerge/resolver/output.py b/lib/_emerge/resolver/output.py
index 3ba197846..b4faafd75 100644
--- a/lib/_emerge/resolver/output.py
+++ b/lib/_emerge/resolver/output.py
@@ -8,7 +8,6 @@ __all__ = (
"Display", "format_unmatched_atom",
)
-import sys
import portage
from portage import os
diff --git a/lib/_emerge/resolver/output_helpers.py b/lib/_emerge/resolver/output_helpers.py
index a4a7d50cf..d5cc9dbcb 100644
--- a/lib/_emerge/resolver/output_helpers.py
+++ b/lib/_emerge/resolver/output_helpers.py
@@ -10,7 +10,6 @@ __all__ = (
import io
import re
-import sys
from portage import os
from portage import _encodings, _unicode_encode
diff --git a/lib/_emerge/resolver/slot_collision.py b/lib/_emerge/resolver/slot_collision.py
index 8375f030e..49034ee8f 100644
--- a/lib/_emerge/resolver/slot_collision.py
+++ b/lib/_emerge/resolver/slot_collision.py
@@ -3,7 +3,6 @@
from __future__ import print_function
-import sys
from portage import _encodings, _unicode_encode
from _emerge.AtomArg import AtomArg
diff --git a/lib/portage/_emirrordist/Config.py b/lib/portage/_emirrordist/Config.py
index 125f05a70..56732089e 100644
--- a/lib/portage/_emirrordist/Config.py
+++ b/lib/portage/_emirrordist/Config.py
@@ -5,7 +5,6 @@ import copy
import io
import logging
import shelve
-import sys
import time
import portage
diff --git a/lib/portage/_emirrordist/FetchTask.py b/lib/portage/_emirrordist/FetchTask.py
index a1ba58822..f2cf2aa20 100644
--- a/lib/portage/_emirrordist/FetchTask.py
+++ b/lib/portage/_emirrordist/FetchTask.py
@@ -7,9 +7,7 @@ import collections
import errno
import logging
import random
-import stat
import subprocess
-import sys
import portage
from portage import _encodings, _unicode_encode
diff --git a/lib/portage/_emirrordist/MirrorDistTask.py b/lib/portage/_emirrordist/MirrorDistTask.py
index c0cf30112..e495ab9bf 100644
--- a/lib/portage/_emirrordist/MirrorDistTask.py
+++ b/lib/portage/_emirrordist/MirrorDistTask.py
@@ -3,7 +3,6 @@
import errno
import logging
-import sys
import time
try:
diff --git a/lib/portage/_selinux.py b/lib/portage/_selinux.py
index 1803415d9..aba40c2dd 100644
--- a/lib/portage/_selinux.py
+++ b/lib/portage/_selinux.py
@@ -5,7 +5,6 @@
# the whole _selinux module itself will be wrapped.
import os
import shutil
-import sys
import warnings
try:
diff --git a/lib/portage/_sets/base.py b/lib/portage/_sets/base.py
index 700b6fca7..46446ccad 100644
--- a/lib/portage/_sets/base.py
+++ b/lib/portage/_sets/base.py
@@ -1,7 +1,6 @@
# Copyright 2007-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
from portage.dep import Atom, ExtendedAtomDict, best_match_to_list, match_from_list
from portage.exception import InvalidAtom
from portage.versions import cpv_getkey
diff --git a/lib/portage/cache/anydbm.py b/lib/portage/cache/anydbm.py
index c02d85b4f..4cdf264e2 100644
--- a/lib/portage/cache/anydbm.py
+++ b/lib/portage/cache/anydbm.py
@@ -14,7 +14,6 @@ except ImportError:
import pickle
from portage import _unicode_encode
from portage import os
-import sys
from portage.cache import fs_template
from portage.cache import cache_errors
diff --git a/lib/portage/cache/flat_hash.py b/lib/portage/cache/flat_hash.py
index 093c7621c..7d5b44511 100644
--- a/lib/portage/cache/flat_hash.py
+++ b/lib/portage/cache/flat_hash.py
@@ -7,7 +7,6 @@ from portage.cache import cache_errors
import errno
import io
import stat
-import sys
import tempfile
import os as _os
from portage import os
diff --git a/lib/portage/cache/fs_template.py b/lib/portage/cache/fs_template.py
index 7d6ff2bbe..a4ca74609 100644
--- a/lib/portage/cache/fs_template.py
+++ b/lib/portage/cache/fs_template.py
@@ -3,7 +3,6 @@
# Author(s): Brian Harring (ferringb@gentoo.org)
import os as _os
-import sys
from portage.cache import template
from portage import os
diff --git a/lib/portage/cache/index/pkg_desc_index.py b/lib/portage/cache/index/pkg_desc_index.py
index 1cb2c6522..c3bcbb933 100644
--- a/lib/portage/cache/index/pkg_desc_index.py
+++ b/lib/portage/cache/index/pkg_desc_index.py
@@ -2,7 +2,6 @@
# Distributed under the terms of the GNU General Public License v2
import collections
-import sys
from portage.versions import _pkg_str
diff --git a/lib/portage/cache/mappings.py b/lib/portage/cache/mappings.py
index 27284b56e..3c1a0a366 100644
--- a/lib/portage/cache/mappings.py
+++ b/lib/portage/cache/mappings.py
@@ -5,7 +5,6 @@
__all__ = ["Mapping", "MutableMapping", "UserDict", "ProtectedDict",
"LazyLoad", "slot_dict_class"]
-import sys
import weakref
class Mapping:
diff --git a/lib/portage/cache/metadata.py b/lib/portage/cache/metadata.py
index b3daec274..db81b8ba1 100644
--- a/lib/portage/cache/metadata.py
+++ b/lib/portage/cache/metadata.py
@@ -5,7 +5,6 @@
import errno
import re
import stat
-import sys
from operator import attrgetter
from portage import os
from portage import _encodings
diff --git a/lib/portage/cache/sql_template.py b/lib/portage/cache/sql_template.py
index ba75a529f..b87612f2d 100644
--- a/lib/portage/cache/sql_template.py
+++ b/lib/portage/cache/sql_template.py
@@ -2,7 +2,6 @@
# Author(s): Brian Harring (ferringb@gentoo.org)
# License: GPL2
-import sys
from portage.cache import template, cache_errors
from portage.cache.template import reconstruct_eclasses
diff --git a/lib/portage/cache/sqlite.py b/lib/portage/cache/sqlite.py
index c1e871a3e..647fd4dae 100644
--- a/lib/portage/cache/sqlite.py
+++ b/lib/portage/cache/sqlite.py
@@ -4,7 +4,6 @@
from __future__ import division
import re
-import sys
from portage.cache import fs_template
from portage.cache import cache_errors
from portage import os
diff --git a/lib/portage/cache/template.py b/lib/portage/cache/template.py
index 850c133de..509f8a2dc 100644
--- a/lib/portage/cache/template.py
+++ b/lib/portage/cache/template.py
@@ -5,7 +5,6 @@
from portage.cache import cache_errors
from portage.cache.cache_errors import InvalidRestriction
from portage.cache.mappings import ProtectedDict
-import sys
import warnings
import operator
diff --git a/lib/portage/checksum.py b/lib/portage/checksum.py
index bcc960526..6e92b17b9 100644
--- a/lib/portage/checksum.py
+++ b/lib/portage/checksum.py
@@ -12,7 +12,6 @@ import errno
import functools
import hashlib
import stat
-import sys
import subprocess
import tempfile
diff --git a/lib/portage/cvstree.py b/lib/portage/cvstree.py
index 808939d61..faa9b5a29 100644
--- a/lib/portage/cvstree.py
+++ b/lib/portage/cvstree.py
@@ -7,7 +7,6 @@ from __future__ import print_function
import io
import re
import stat
-import sys
import time
from portage import os
diff --git a/lib/portage/data.py b/lib/portage/data.py
index f9d67fc3d..93ddfec03 100644
--- a/lib/portage/data.py
+++ b/lib/portage/data.py
@@ -2,7 +2,10 @@
# Copyright 1998-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-import os, pwd, grp, platform, sys
+import grp
+import os
+import platform
+import pwd
import portage
portage.proxy.lazyimport.lazyimport(globals(),
diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py
index 102799f3d..75c08f5a3 100644
--- a/lib/portage/dbapi/bintree.py
+++ b/lib/portage/dbapi/bintree.py
@@ -44,7 +44,6 @@ import errno
import io
import stat
import subprocess
-import sys
import tempfile
import textwrap
import time
diff --git a/lib/portage/dbapi/porttree.py b/lib/portage/dbapi/porttree.py
index 14f1baa50..a6e83b229 100644
--- a/lib/portage/dbapi/porttree.py
+++ b/lib/portage/dbapi/porttree.py
@@ -39,7 +39,6 @@ from portage.util.futures.iter_completed import iter_gather
from _emerge.EbuildMetadataPhase import EbuildMetadataPhase
import os as _os
-import sys
import traceback
import warnings
import errno
diff --git a/lib/portage/dbapi/vartree.py b/lib/portage/dbapi/vartree.py
index f22aa60ae..0b04ab8ea 100644
--- a/lib/portage/dbapi/vartree.py
+++ b/lib/portage/dbapi/vartree.py
@@ -97,7 +97,6 @@ import platform
import pwd
import re
import stat
-import sys
import tempfile
import textwrap
import time
diff --git a/lib/portage/dep/soname/SonameAtom.py b/lib/portage/dep/soname/SonameAtom.py
index 56667f15f..62b2ee5e1 100644
--- a/lib/portage/dep/soname/SonameAtom.py
+++ b/lib/portage/dep/soname/SonameAtom.py
@@ -1,7 +1,6 @@
# Copyright 2015-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
from portage import _encodings, _unicode_encode
diff --git a/lib/portage/eclass_cache.py b/lib/portage/eclass_cache.py
index 4a09b82fb..5a8e6ee6a 100644
--- a/lib/portage/eclass_cache.py
+++ b/lib/portage/eclass_cache.py
@@ -5,7 +5,6 @@
__all__ = ["cache"]
import stat
-import sys
import operator
import warnings
from portage.util import normalize_path
diff --git a/lib/portage/elog/mod_save_summary.py b/lib/portage/elog/mod_save_summary.py
index 7aa6f2bef..946a1ad4c 100644
--- a/lib/portage/elog/mod_save_summary.py
+++ b/lib/portage/elog/mod_save_summary.py
@@ -4,7 +4,6 @@
import errno
import io
-import sys
import time
import portage
from portage import os
diff --git a/lib/portage/elog/mod_syslog.py b/lib/portage/elog/mod_syslog.py
index e5d1bbca8..4dabacc52 100644
--- a/lib/portage/elog/mod_syslog.py
+++ b/lib/portage/elog/mod_syslog.py
@@ -2,7 +2,6 @@
# Copyright 2006-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-import sys
import syslog
from portage.const import EBUILD_PHASES
from portage import _encodings
diff --git a/lib/portage/emaint/modules/binhost/binhost.py b/lib/portage/emaint/modules/binhost/binhost.py
index 9b07470d0..1cdb3634b 100644
--- a/lib/portage/emaint/modules/binhost/binhost.py
+++ b/lib/portage/emaint/modules/binhost/binhost.py
@@ -9,7 +9,6 @@ from portage import os
from portage.util import writemsg
from portage.versions import _pkg_str
-import sys
class BinhostHandler:
diff --git a/lib/portage/emaint/modules/sync/sync.py b/lib/portage/emaint/modules/sync/sync.py
index 41375aeaa..a8da68065 100644
--- a/lib/portage/emaint/modules/sync/sync.py
+++ b/lib/portage/emaint/modules/sync/sync.py
@@ -1,9 +1,7 @@
# Copyright 2014-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import logging
import os
-import sys
import portage
portage._internal_caller = True
diff --git a/lib/portage/exception.py b/lib/portage/exception.py
index e2be95c1e..51e1fec3e 100644
--- a/lib/portage/exception.py
+++ b/lib/portage/exception.py
@@ -2,7 +2,6 @@
# Distributed under the terms of the GNU General Public License v2
import signal
-import sys
from portage import _encodings, _unicode_encode, _unicode_decode
from portage.localization import _
diff --git a/lib/portage/manifest.py b/lib/portage/manifest.py
index 40f84a9b4..a92d3b600 100644
--- a/lib/portage/manifest.py
+++ b/lib/portage/manifest.py
@@ -6,7 +6,6 @@ import io
import logging
import re
import stat
-import sys
import warnings
import portage
diff --git a/lib/portage/package/ebuild/getmaskingstatus.py b/lib/portage/package/ebuild/getmaskingstatus.py
index 0cfc619dc..5336a406a 100644
--- a/lib/portage/package/ebuild/getmaskingstatus.py
+++ b/lib/portage/package/ebuild/getmaskingstatus.py
@@ -3,7 +3,6 @@
__all__ = ['getmaskingstatus']
-import sys
import portage
from portage import eapi_is_supported, _eapi_is_deprecated
diff --git a/lib/portage/proxy/objectproxy.py b/lib/portage/proxy/objectproxy.py
index 5e003049c..7d03dbef6 100644
--- a/lib/portage/proxy/objectproxy.py
+++ b/lib/portage/proxy/objectproxy.py
@@ -1,7 +1,6 @@
# Copyright 2008-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
__all__ = ['ObjectProxy']
diff --git a/lib/portage/repository/config.py b/lib/portage/repository/config.py
index c27573c15..8c36c12e4 100644
--- a/lib/portage/repository/config.py
+++ b/lib/portage/repository/config.py
@@ -4,7 +4,6 @@
import io
import logging
import warnings
-import sys
import re
import portage
diff --git a/lib/portage/sync/getaddrinfo_validate.py b/lib/portage/sync/getaddrinfo_validate.py
index 8ed87626e..fd77f4875 100644
--- a/lib/portage/sync/getaddrinfo_validate.py
+++ b/lib/portage/sync/getaddrinfo_validate.py
@@ -1,7 +1,6 @@
# Copyright 2010-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
def getaddrinfo_validate(addrinfos):
diff --git a/lib/portage/sync/modules/rsync/rsync.py b/lib/portage/sync/modules/rsync/rsync.py
index 02f53c08e..33019534b 100644
--- a/lib/portage/sync/modules/rsync/rsync.py
+++ b/lib/portage/sync/modules/rsync/rsync.py
@@ -10,7 +10,6 @@ import datetime
import io
import re
import random
-import subprocess
import tempfile
import portage
diff --git a/lib/portage/tests/dep/test_match_from_list.py b/lib/portage/tests/dep/test_match_from_list.py
index 878164889..35ba3a445 100644
--- a/lib/portage/tests/dep/test_match_from_list.py
+++ b/lib/portage/tests/dep/test_match_from_list.py
@@ -1,7 +1,6 @@
# Copyright 2006-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
from portage.tests import TestCase
from portage.dep import Atom, match_from_list, _repo_separator
from portage.versions import catpkgsplit, _pkg_str
diff --git a/lib/portage/tests/dep/test_soname_atom_pickle.py b/lib/portage/tests/dep/test_soname_atom_pickle.py
index 14755440c..03a4893d1 100644
--- a/lib/portage/tests/dep/test_soname_atom_pickle.py
+++ b/lib/portage/tests/dep/test_soname_atom_pickle.py
@@ -1,7 +1,6 @@
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
from portage.dep.soname.SonameAtom import SonameAtom
from portage.tests import TestCase
diff --git a/lib/portage/tests/ebuild/test_spawn.py b/lib/portage/tests/ebuild/test_spawn.py
index a38e10972..2e2b47eb9 100644
--- a/lib/portage/tests/ebuild/test_spawn.py
+++ b/lib/portage/tests/ebuild/test_spawn.py
@@ -3,7 +3,6 @@
import errno
import io
-import sys
import tempfile
import portage
from portage import os
diff --git a/lib/portage/tests/lint/test_bash_syntax.py b/lib/portage/tests/lint/test_bash_syntax.py
index fdbb6fe88..da6ee4f45 100644
--- a/lib/portage/tests/lint/test_bash_syntax.py
+++ b/lib/portage/tests/lint/test_bash_syntax.py
@@ -4,7 +4,6 @@
from itertools import chain
import stat
import subprocess
-import sys
from portage.const import BASH_BINARY, PORTAGE_BASE_PATH, PORTAGE_BIN_PATH
from portage.tests import TestCase
diff --git a/lib/portage/tests/process/test_poll.py b/lib/portage/tests/process/test_poll.py
index 3ea176c0d..dc11f6d13 100644
--- a/lib/portage/tests/process/test_poll.py
+++ b/lib/portage/tests/process/test_poll.py
@@ -5,7 +5,6 @@ import functools
import pty
import shutil
import socket
-import sys
import tempfile
from portage import os
diff --git a/lib/portage/tests/resolver/ResolverPlayground.py b/lib/portage/tests/resolver/ResolverPlayground.py
index 281cd0736..b15cc7f36 100644
--- a/lib/portage/tests/resolver/ResolverPlayground.py
+++ b/lib/portage/tests/resolver/ResolverPlayground.py
@@ -4,7 +4,6 @@
import bz2
from itertools import permutations
import fnmatch
-import sys
import tempfile
import portage
from portage import os
diff --git a/lib/portage/tests/sync/test_sync_local.py b/lib/portage/tests/sync/test_sync_local.py
index 5fb8afb7c..08dd4fe57 100644
--- a/lib/portage/tests/sync/test_sync_local.py
+++ b/lib/portage/tests/sync/test_sync_local.py
@@ -5,7 +5,6 @@ import datetime
import subprocess
import sys
import textwrap
-import time
import portage
from portage import os, shutil, _shell_quote
diff --git a/lib/portage/tests/unicode/test_string_format.py b/lib/portage/tests/unicode/test_string_format.py
index 561feeea1..3b994d622 100644
--- a/lib/portage/tests/unicode/test_string_format.py
+++ b/lib/portage/tests/unicode/test_string_format.py
@@ -1,7 +1,6 @@
# Copyright 2010-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-import sys
from portage import _encodings, _unicode_encode
from portage.exception import PortageException
diff --git a/lib/portage/tests/util/futures/asyncio/test_pipe_closed.py b/lib/portage/tests/util/futures/asyncio/test_pipe_closed.py
index 3cf88f32d..d9ada8b70 100644
--- a/lib/portage/tests/util/futures/asyncio/test_pipe_closed.py
+++ b/lib/portage/tests/util/futures/asyncio/test_pipe_closed.py
@@ -6,7 +6,6 @@ import os
import pty
import shutil
import socket
-import sys
import tempfile
from portage.tests import TestCase
diff --git a/lib/portage/tests/util/futures/asyncio/test_subprocess_exec.py b/lib/portage/tests/util/futures/asyncio/test_subprocess_exec.py
index 6ad987316..6128a7d06 100644
--- a/lib/portage/tests/util/futures/asyncio/test_subprocess_exec.py
+++ b/lib/portage/tests/util/futures/asyncio/test_subprocess_exec.py
@@ -3,7 +3,6 @@
import os
import subprocess
-import sys
from portage.process import find_binary
from portage.tests import TestCase
diff --git a/lib/portage/tests/util/futures/test_retry.py b/lib/portage/tests/util/futures/test_retry.py
index 124e25614..d2605886c 100644
--- a/lib/portage/tests/util/futures/test_retry.py
+++ b/lib/portage/tests/util/futures/test_retry.py
@@ -8,7 +8,6 @@ try:
except ImportError:
import dummy_threading as threading
-import sys
import time
from portage.tests import TestCase
diff --git a/lib/portage/tests/util/test_socks5.py b/lib/portage/tests/util/test_socks5.py
index be0021e30..ca32651a7 100644
--- a/lib/portage/tests/util/test_socks5.py
+++ b/lib/portage/tests/util/test_socks5.py
@@ -2,11 +2,9 @@
# Distributed under the terms of the GNU General Public License v2
import functools
-import platform
import shutil
import socket
import struct
-import sys
import tempfile
import time
diff --git a/lib/portage/util/_async/PipeLogger.py b/lib/portage/util/_async/PipeLogger.py
index aa240806d..39ebf9aee 100644
--- a/lib/portage/util/_async/PipeLogger.py
+++ b/lib/portage/util/_async/PipeLogger.py
@@ -4,7 +4,6 @@
import fcntl
import errno
import gzip
-import sys
import portage
from portage import os, _encodings, _unicode_encode
diff --git a/lib/portage/util/_compare_files.py b/lib/portage/util/_compare_files.py
index c3223d956..de97a9d9d 100644
--- a/lib/portage/util/_compare_files.py
+++ b/lib/portage/util/_compare_files.py
@@ -6,7 +6,6 @@ __all__ = ["compare_files"]
import io
import os
import stat
-import sys
from portage import _encodings
from portage import _unicode_encode
diff --git a/lib/portage/util/_desktop_entry.py b/lib/portage/util/_desktop_entry.py
index 9fa06b97b..74053a30f 100644
--- a/lib/portage/util/_desktop_entry.py
+++ b/lib/portage/util/_desktop_entry.py
@@ -1,7 +1,6 @@
# Copyright 2012-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-import io
import re
import subprocess
import sys
diff --git a/lib/portage/util/_dyn_libs/LinkageMapELF.py b/lib/portage/util/_dyn_libs/LinkageMapELF.py
index b47cb1251..57fcf4682 100644
--- a/lib/portage/util/_dyn_libs/LinkageMapELF.py
+++ b/lib/portage/util/_dyn_libs/LinkageMapELF.py
@@ -6,7 +6,6 @@ import errno
import itertools
import logging
import subprocess
-import sys
import portage
from portage import _encodings
diff --git a/lib/portage/util/_dyn_libs/NeededEntry.py b/lib/portage/util/_dyn_libs/NeededEntry.py
index 05b0b1689..20dc2f779 100644
--- a/lib/portage/util/_dyn_libs/NeededEntry.py
+++ b/lib/portage/util/_dyn_libs/NeededEntry.py
@@ -1,7 +1,6 @@
# Copyright 2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-import sys
from portage import _encodings, _unicode_encode
from portage.exception import InvalidData
diff --git a/lib/portage/util/_dyn_libs/PreservedLibsRegistry.py b/lib/portage/util/_dyn_libs/PreservedLibsRegistry.py
index 68b79a18d..d6f1d5e29 100644
--- a/lib/portage/util/_dyn_libs/PreservedLibsRegistry.py
+++ b/lib/portage/util/_dyn_libs/PreservedLibsRegistry.py
@@ -6,7 +6,6 @@ import json
import logging
import pickle
import stat
-import sys
from portage import abssymlink
from portage import os
diff --git a/lib/portage/util/_eventloop/EventLoop.py b/lib/portage/util/_eventloop/EventLoop.py
index 9d2b91145..b111238a6 100644
--- a/lib/portage/util/_eventloop/EventLoop.py
+++ b/lib/portage/util/_eventloop/EventLoop.py
@@ -10,7 +10,6 @@ import logging
import os
import select
import signal
-import sys
import time
import traceback
diff --git a/lib/portage/util/_eventloop/global_event_loop.py b/lib/portage/util/_eventloop/global_event_loop.py
index 73b7db0d3..1db958d2e 100644
--- a/lib/portage/util/_eventloop/global_event_loop.py
+++ b/lib/portage/util/_eventloop/global_event_loop.py
@@ -2,7 +2,6 @@
# Distributed under the terms of the GNU General Public License v2
import os
-import sys
from .EventLoop import EventLoop
from portage.util._eventloop.asyncio_event_loop import AsyncioEventLoop
diff --git a/lib/portage/util/_urlopen.py b/lib/portage/util/_urlopen.py
index de0363533..28c4e89f8 100644
--- a/lib/portage/util/_urlopen.py
+++ b/lib/portage/util/_urlopen.py
@@ -2,7 +2,6 @@
# Distributed under the terms of the GNU General Public License v2
import io
-import sys
from datetime import datetime
from time import mktime
from email.utils import formatdate, parsedate
diff --git a/lib/portage/util/compression_probe.py b/lib/portage/util/compression_probe.py
index d3f3de7a2..6c2140794 100644
--- a/lib/portage/util/compression_probe.py
+++ b/lib/portage/util/compression_probe.py
@@ -4,7 +4,6 @@
import ctypes
import errno
import re
-import sys
from portage import _encodings, _unicode_encode
diff --git a/lib/portage/util/configparser.py b/lib/portage/util/configparser.py
index 9bd9f9722..8563d5c8c 100644
--- a/lib/portage/util/configparser.py
+++ b/lib/portage/util/configparser.py
@@ -9,7 +9,6 @@ __all__ = ['ConfigParserError', 'NoOptionError', 'ParsingError',
# - RawConfigParser that provides no interpolation for values.
import io
-import sys
from configparser import (Error as ConfigParserError,
NoOptionError, ParsingError, RawConfigParser)
diff --git a/lib/portage/util/digraph.py b/lib/portage/util/digraph.py
index 2a7efc11e..c262cddee 100644
--- a/lib/portage/util/digraph.py
+++ b/lib/portage/util/digraph.py
@@ -5,7 +5,6 @@ __all__ = ['digraph']
import bisect
from collections import deque
-import sys
from portage.util import writemsg
diff --git a/lib/portage/util/env_update.py b/lib/portage/util/env_update.py
index 5c036b6ba..9c6fe3cdd 100644
--- a/lib/portage/util/env_update.py
+++ b/lib/portage/util/env_update.py
@@ -7,7 +7,6 @@ import errno
import glob
import io
import stat
-import sys
import time
import portage
diff --git a/lib/portage/util/install_mask.py b/lib/portage/util/install_mask.py
index acb9ba15b..9442128bd 100644
--- a/lib/portage/util/install_mask.py
+++ b/lib/portage/util/install_mask.py
@@ -6,9 +6,7 @@ __all__ = ['install_mask_dir', 'InstallMask']
import collections
import errno
import fnmatch
-import functools
import operator
-import sys
from portage import os, _unicode_decode
from portage.exception import (
diff --git a/lib/portage/util/listdir.py b/lib/portage/util/listdir.py
index 37312beb6..e6fb9c06d 100644
--- a/lib/portage/util/listdir.py
+++ b/lib/portage/util/listdir.py
@@ -5,7 +5,6 @@ __all__ = ['cacheddir', 'listdir']
import errno
import stat
-import sys
from portage import os
diff --git a/lib/portage/util/movefile.py b/lib/portage/util/movefile.py
index 6321471e3..3a17d5240 100644
--- a/lib/portage/util/movefile.py
+++ b/lib/portage/util/movefile.py
@@ -9,7 +9,6 @@ import errno
import fnmatch
import os as _os
import stat
-import sys
import textwrap
import portage
diff --git a/lib/portage/util/mtimedb.py b/lib/portage/util/mtimedb.py
index ff2ad55e9..b8ceeff8e 100644
--- a/lib/portage/util/mtimedb.py
+++ b/lib/portage/util/mtimedb.py
@@ -12,7 +12,6 @@ except ImportError:
import errno
import io
import json
-import sys
import portage
from portage import _encodings
diff --git a/lib/portage/util/whirlpool.py b/lib/portage/util/whirlpool.py
index a947dd719..3c027fd2a 100644
--- a/lib/portage/util/whirlpool.py
+++ b/lib/portage/util/whirlpool.py
@@ -25,7 +25,6 @@
##
## This Python implementation is therefore also placed in the public domain.
-import sys
#block_size = 64
diff --git a/lib/portage/versions.py b/lib/portage/versions.py
index d16c41b30..af3ec67d8 100644
--- a/lib/portage/versions.py
+++ b/lib/portage/versions.py
@@ -9,7 +9,6 @@ __all__ = [
]
import re
-import sys
import warnings
from functools import lru_cache
diff --git a/lib/portage/xml/metadata.py b/lib/portage/xml/metadata.py
index 942c2bc61..75321e6b8 100644
--- a/lib/portage/xml/metadata.py
+++ b/lib/portage/xml/metadata.py
@@ -30,7 +30,6 @@
__all__ = ('MetaDataXML', 'parse_metadata_use')
-import sys
try:
import xml.etree.cElementTree as etree
diff --git a/lib/portage/xpak.py b/lib/portage/xpak.py
index 0db2be089..3401c5073 100644
--- a/lib/portage/xpak.py
+++ b/lib/portage/xpak.py
@@ -24,7 +24,6 @@ __all__ = [
import array
import errno
-import sys
import portage
from portage import os