Update exception handling to use `except X as Y` syntax.
[update-copyright.git] / update_copyright / utils.py
index e950596b6e1dab75a1bed93c42bb08027c2498b2..117235149b469d0cb992e6c64dad59d5ee402e19 100644 (file)
@@ -1,20 +1,19 @@
-# Copyright (C) 2012 W. Trevor King
+# Copyright (C) 2012 W. Trevor King <wking@tremily.us>
 #
 # This file is part of update-copyright.
 #
-# update-copyright is free software: you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
+# update-copyright is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
 #
-# update-copyright is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
+# update-copyright is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
 #
-# You should have received a copy of the GNU General Public License
-# along with update-copyright.  If not, see
-# <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU General Public License along with
+# update-copyright.  If not, see <http://www.gnu.org/licenses/>.
 
 import codecs as _codecs
 import difflib as _difflib
@@ -129,11 +128,11 @@ def copyright_string(original_year, final_year, authors, text, 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
-        except TypeError, e:
+        except TypeError as e:
             _LOG.error(
                 ('{}: copright text must be a list of paragraph strings, '
                  'not {}').format(e, repr(text)))