-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python lint: Use flake8 --extend-ignore instead of --ignore #1498
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -784,7 +784,7 @@ def GIT(must_succeed=True): | |
if ret == 0: | ||
cached_git_executable = git | ||
return git | ||
except: | ||
except Exception: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When we are trying to catch everything, why not use the shorter form? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this bad?A bare https://peps.python.org/pep-0008/#programming-recommendations
try:
import platform_specific_module
except ImportError:
platform_specific_module = None
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yes we don't want to catch KeyboardInterrupt here I guess |
||
pass | ||
if must_succeed: | ||
if WINDOWS: | ||
|
@@ -853,7 +853,7 @@ def git_pull(repo_path, branch_or_tag): | |
if ret != 0: | ||
return False | ||
run([GIT(), 'submodule', 'update', '--init'], repo_path, quiet=True) | ||
except: | ||
except Exception: | ||
errlog('git operation failed!') | ||
return False | ||
print("Successfully updated and checked out branch/tag '" + branch_or_tag + "' on repository '" + repo_path + "'") | ||
|
@@ -1041,7 +1041,7 @@ def xcode_sdk_version(): | |
if sys.version_info >= (3,): | ||
output = output.decode('utf8') | ||
return output.strip().split('.') | ||
except: | ||
except Exception: | ||
return subprocess.checkplatform.mac_ver()[0].split('.') | ||
|
||
|
||
|
@@ -1490,14 +1490,14 @@ def load_em_config(): | |
lines = [] | ||
try: | ||
lines = open(EM_CONFIG_PATH, "r").read().split('\n') | ||
except: | ||
except Exception: | ||
pass | ||
for line in lines: | ||
try: | ||
key, value = parse_key_value(line) | ||
if value != '': | ||
EM_CONFIG_DICT[key] = value | ||
except: | ||
except Exception: | ||
pass | ||
|
||
|
||
|
@@ -2127,13 +2127,13 @@ def make_url(ext): | |
make_url('tar.xz' if not WINDOWS else 'zip') | ||
try: | ||
urlopen(make_url('tar.xz' if not WINDOWS else 'zip')) | ||
except: | ||
except Exception: | ||
if not WINDOWS: | ||
# Try the old `.tbz2` name | ||
# TODO:remove this once tot builds are all using xz | ||
try: | ||
urlopen(make_url('tbz2')) | ||
except: | ||
except Exception: | ||
continue | ||
else: | ||
continue | ||
|
@@ -2918,7 +2918,7 @@ def extract_string_arg(name): | |
build_type_index = [x.lower() for x in build_types].index(build_type.lower()) | ||
CMAKE_BUILD_TYPE_OVERRIDE = build_types[build_type_index] | ||
args[i] = '' | ||
except: | ||
except Exception: | ||
errlog('Unknown CMake build type "' + build_type + '" specified! Please specify one of ' + str(build_types)) | ||
return 1 | ||
else: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wasn't needed before?