[Tools] Fix static analyis issues
This commit addresses issues identified by LGTM for the various independent (and mostly-independent) files in the Tools subdirectory. The vast majority of the issues are trivial, and are things like unused imports or catching BaseException. There was one true bug identified, a global variable being changed in a function where it was not marked global, but it only affected output quantity (the variable is named "VERBOSE"). A couple of other issues identified variables that appear to represent no-longer-existing options in the code. The options were left, but a deprecation printout replaces the variable in the event the option is provided.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import os
|
||||
import sys
|
||||
from subprocess import Popen, PIPE, check_call, check_output
|
||||
import pprint
|
||||
from subprocess import check_call, check_output
|
||||
import re
|
||||
import logging
|
||||
|
||||
@@ -237,7 +236,7 @@ def build_deps_graph(graph, bundle_path, dirs_filter=None, search_paths=[]):
|
||||
|
||||
try:
|
||||
deps = create_dep_nodes(list_install_names(k2), s_paths)
|
||||
except:
|
||||
except Exception:
|
||||
logging.error("Failed to resolve dependency in " + k2)
|
||||
raise
|
||||
|
||||
@@ -341,7 +340,7 @@ def change_libid(graph, node, bundle_path):
|
||||
logging.debug(" ~ id: " + node.name)
|
||||
try:
|
||||
check_call([ "install_name_tool", "-id", node.name, lib ])
|
||||
except:
|
||||
except Exception:
|
||||
logging.warning("Failed to change bundle id {} in lib {}".format(node.name, lib))
|
||||
|
||||
def print_child(graph, node, path):
|
||||
|
||||
Reference in New Issue
Block a user