diff options
author | Petr Viktorin <pviktori@redhat.com> | 2015-07-30 16:49:29 +0200 |
---|---|---|
committer | Tomas Babej <tbabej@redhat.com> | 2015-08-12 18:17:23 +0200 |
commit | 27dabb45282911e375336f75934af9dd6cc5d963 (patch) | |
tree | 3c8fe5255d60613fa9cd14d053b3688feed740c9 /ipatests/i18n.py | |
parent | a651be3eec2a08bd2865b16b0eed767db69aab0f (diff) | |
download | freeipa-27dabb45282911e375336f75934af9dd6cc5d963.tar.gz freeipa-27dabb45282911e375336f75934af9dd6cc5d963.tar.xz freeipa-27dabb45282911e375336f75934af9dd6cc5d963.zip |
Modernize 'except' clauses
The 'as' syntax works from Python 2 on, and Python 3 will
drop the "comma" syntax.
Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipatests/i18n.py')
-rwxr-xr-x | ipatests/i18n.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ipatests/i18n.py b/ipatests/i18n.py index 7d31e4d87..369871658 100755 --- a/ipatests/i18n.py +++ b/ipatests/i18n.py @@ -415,7 +415,7 @@ def validate_file(file_path, validation_mode, reference_pot=None): try: po = polib.pofile(file_path) - except Exception, e: + except Exception as e: error_lines.append(entry_seperator) error_lines.append('Unable to parse file "%s": %s' % (file_path, e)) n_errors += 1 @@ -528,7 +528,7 @@ def create_po(pot_file, po_file, mo_file): return 1 try: po = polib.pofile(pot_file) - except Exception, e: + except Exception as e: print >>sys.stderr, 'Unable to parse file "%s": %s' % (pot_file, e) return 1 @@ -619,7 +619,7 @@ def po_file_iterate(po_file, get_msgstr, get_msgstr_plural): return 1 try: po = polib.pofile(po_file) - except Exception, e: + except Exception as e: print >>sys.stderr, 'Unable to parse file "%s": %s' % (po_file, e) return 1 @@ -638,7 +638,7 @@ def po_file_iterate(po_file, get_msgstr, get_msgstr_plural): n_translations += 1 validate_unicode_edit(msgid, msgstr) n_valid += 1 - except Exception, e: + except Exception as e: n_fail += 1 if print_traceback: traceback.print_exc() @@ -648,7 +648,7 @@ def po_file_iterate(po_file, get_msgstr, get_msgstr_plural): n_translations += 1 validate_unicode_edit(msgid_plural, msgstr_plural) n_valid += 1 - except Exception, e: + except Exception as e: n_fail += 1 if print_traceback: traceback.print_exc() @@ -663,7 +663,7 @@ def po_file_iterate(po_file, get_msgstr, get_msgstr_plural): n_translations += 1 validate_unicode_edit(msgid, msgstr) n_valid += 1 - except Exception, e: + except Exception as e: n_fail += 1 if print_traceback: traceback.print_exc() @@ -671,7 +671,7 @@ def po_file_iterate(po_file, get_msgstr, get_msgstr_plural): n_entries += 1 - except Exception, e: + except Exception as e: if print_traceback: traceback.print_exc() print >> sys.stderr, "ERROR: %s" % e |