Skip to content

Commit

Permalink
Enable Flake8 E722
Browse files Browse the repository at this point in the history
This check looks for uses of bare 'except:'; these are bad because they
catch e.g. SystemExit, which should not normally be caught.
  • Loading branch information
jbytheway committed Sep 24, 2020
1 parent 5bcd338 commit f69d2cb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ ignore =
E305,
E501,
E713,
E722,
# W503 and W504 require line breaks after or before binary operators; you
# can only have one enabled
W504
2 changes: 1 addition & 1 deletion tools/gfx_tools/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def walk_dirs(self, refs):
with open(filepath, "r") as fp:
try:
tile_entry = json.load(fp)
except:
except Exception:
print("error loading {}".format(filepath))
raise

Expand Down
2 changes: 1 addition & 1 deletion tools/update_blueprint_needs.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def main(argv):
try:
with open(json_path, 'r', encoding='utf-8') as fs:
content = json.load(fs)
except:
except Exception:
sys.stderr.write('Error parsing %r\n' % json_path)
raise
if type(content) is list:
Expand Down
6 changes: 3 additions & 3 deletions utilities/make_iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,19 @@ def tile_convert(otile, main_id, new_tile_number):

try:
os.mkdir(new_tileset_name)
except:
except OSError:
pass

try:
os.mkdir(os.path.join(new_tileset_name, 'tiles'))
except:
except OSError:
pass

os.system('rm -rf ' + new_tileset_name + '/tiles/*')

try:
os.mkdir(os.path.join(new_tiles_dir, 'to_merge'))
except:
except OSError:
pass

print('reading ' + old_tileset_name + '/tile_config.json')
Expand Down

0 comments on commit f69d2cb

Please sign in to comment.