projects
/
update-copyright.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update exception handling to use `except X as Y` syntax.
[update-copyright.git]
/
update_copyright
/
utils.py
diff --git
a/update_copyright/utils.py
b/update_copyright/utils.py
index f20c301fa60ad6eaada85e6353cf1871cd6ea6c6..117235149b469d0cb992e6c64dad59d5ee402e19 100644
(file)
--- a/
update_copyright/utils.py
+++ b/
update_copyright/utils.py
@@
-128,11
+128,11
@@
def copyright_string(original_year, final_year, authors, text, info={},
for i,paragraph in enumerate(text):
try:
text[i] = paragraph % info
for i,paragraph in enumerate(text):
try:
text[i] = paragraph % info
- except ValueError
,
e:
+ except ValueError
as
e:
_LOG.error(
"{}: can't format {} with {}".format(e, paragraph, info))
raise
_LOG.error(
"{}: can't format {} with {}".format(e, paragraph, info))
raise
- except TypeError
,
e:
+ except TypeError
as
e:
_LOG.error(
('{}: copright text must be a list of paragraph strings, '
'not {}').format(e, repr(text)))
_LOG.error(
('{}: copright text must be a list of paragraph strings, '
'not {}').format(e, repr(text)))