lint: clean up old statements
We can delete a number of disable statements that are no longer relevant,
replace the W/E/F constants with their human readable names, and scope a
few to where they're needed instead of disabling in the entire module.
BUG=None
TEST=`cros lint` is unchanged
Change-Id: Ic7ac1ab410917b075212b38412f8a1e381b8b915
Reviewed-on: https://chromium-review.googlesource.com/1135635
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Don Garrett <dgarrett@chromium.org>
diff --git a/scripts/parallel_emerge.py b/scripts/parallel_emerge.py
index effa074..af63425 100644
--- a/scripts/parallel_emerge.py
+++ b/scripts/parallel_emerge.py
@@ -28,7 +28,7 @@
except ImportError:
# Python-3 renamed to "queue". We still use Queue to avoid collisions
# with naming variables as "queue". Maybe we'll transition at some point.
- # pylint: disable=F0401
+ # pylint: disable=import-error
import queue as Queue
import signal
import subprocess
@@ -78,7 +78,7 @@
# /usr/lib/portage/pym/.
#
# TODO(davidjames): Update Portage to expose public APIs for these features.
-# pylint: disable=F0401
+# pylint: disable=import-error
from _emerge.actions import adjust_configs
from _emerge.actions import load_emerge_config
from _emerge.create_depgraph_params import create_depgraph_params
@@ -92,7 +92,7 @@
from portage._global_updates import _global_updates
import portage
import portage.debug
-# pylint: enable=F0401
+# pylint: enable=import-error
def Usage():
@@ -485,7 +485,7 @@
# Build our own tree from the emerge digraph.
deps_tree = {}
- # pylint: disable=W0212
+ # pylint: disable=protected-access
digraph = depgraph._dynamic_config.digraph
root = emerge.settings["ROOT"]
final_db = depgraph._dynamic_config._filtered_trees[root]['graph_db']
@@ -994,7 +994,7 @@
2: output.fileno(),
sys.stdin.fileno(): sys.stdin.fileno(),
output.fileno(): output.fileno()}
- # pylint: disable=W0212
+ # pylint: disable=protected-access
portage.process._setup_pipes(fd_pipes, close_fds=False)
# Portage doesn't like when sys.stdin.fileno() != 0, so point sys.stdin
@@ -1017,14 +1017,14 @@
# We catch all exceptions here (including SystemExit, KeyboardInterrupt,
# etc) so as to ensure that we don't confuse the multiprocessing module,
# which expects that all forked children exit with os._exit().
- # pylint: disable=W0702
+ # pylint: disable=bare-except
except:
traceback.print_exc(file=output)
job_state.retcode = 1
sys.stdout.flush()
sys.stderr.flush()
output.flush()
- # pylint: disable=W0212
+ # pylint: disable=protected-access
os._exit(job_state.retcode)
else:
# Return the exit code of the subprocess.
@@ -1104,7 +1104,7 @@
bindb = emerge.trees[root]["bintree"].dbapi
# Might be a set, might be a list, might be None; no clue, just use shallow
# copy to ensure we can roll it back.
- # pylint: disable=W0212
+ # pylint: disable=protected-access
original_remotepkgs = copy.copy(bindb.bintree._remotepkgs)
opts, spinner = emerge.opts, emerge.spinner
@@ -1483,7 +1483,7 @@
# Loop until the children exit. We exit with os._exit to be sure we
# don't run any finalizers (those will be run by the child process.)
- # pylint: disable=W0212
+ # pylint: disable=protected-access
while True:
try:
# Wait for the process to exit. When it does, exit with the return
@@ -1940,7 +1940,7 @@
# packages.
portage_upgrade = False
root = emerge.settings["ROOT"]
- # pylint: disable=W0212
+ # pylint: disable=protected-access
if root == "/":
final_db = emerge.depgraph._dynamic_config._filtered_trees[root]['graph_db']
for db_pkg in final_db.cp_list("sys-apps/portage"):
@@ -1982,7 +1982,7 @@
try:
scheduler.Run()
finally:
- # pylint: disable=W0212
+ # pylint: disable=protected-access
scheduler._Shutdown()
scheduler = None