Skip to content

Commit

Permalink
Fix some would-be linting errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmpilato committed Jan 4, 2021
1 parent c8cf57b commit 3541bd8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tools/bump-copyright-years
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ _copyright_re = re.compile(r'Copyright (\(c\)|©) ([0-9]{4}-)?([0-9]{4}) '
def replace_end_year(path, year):
try:
lines = open(path, 'r').readlines()
except Exception as e:
except Exception:
sys.stderr.write("WARNING: Unable to parse file as text: %s\n" % (path))
return
for i in range(len(lines)):
Expand All @@ -51,8 +51,9 @@ def bump_years_recursive(target_dir, year):
if os.path.isfile(child_path):
try:
replace_end_year(child_path, year)
except Exception as e:
sys.stderr.write("ERROR bumping copyright in file: %s\n" % (child_path))
except Exception:
sys.stderr.write("ERROR bumping copyright in file: %s\n"
% (child_path))
raise
elif os.path.isdir(child_path):
bump_years_recursive(child_path, year)
Expand Down

0 comments on commit 3541bd8

Please # to comment.