← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-except-parens into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-except-parens into launchpad:master.

Commit message:
Fix Python 3 syntax errors in {POFile,POTemplate}.importFromQueue

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/379669

Splitting the exception target onto a new line with parentheses worked in Python 2, but is a syntax error in Python 3.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-except-parens into launchpad:master.
diff --git a/lib/lp/translations/model/pofile.py b/lib/lp/translations/model/pofile.py
index c490f64..01187aa 100644
--- a/lib/lp/translations/model/pofile.py
+++ b/lib/lp/translations/model/pofile.py
@@ -983,8 +983,8 @@ class POFile(SQLBase, POFileMixIn):
             entry_to_import.setErrorOutput(
                 "File was not exported from Launchpad.")
         except (MixedNewlineMarkersError, TranslationFormatSyntaxError,
-                TranslationFormatInvalidInputError, UnicodeDecodeError) as (
-                exception):
+                TranslationFormatInvalidInputError,
+                UnicodeDecodeError) as exception:
             # The import failed with a format error. We log it and select the
             # email template.
             if logger:
diff --git a/lib/lp/translations/model/potemplate.py b/lib/lp/translations/model/potemplate.py
index f30c186..ba0a632 100644
--- a/lib/lp/translations/model/potemplate.py
+++ b/lib/lp/translations/model/potemplate.py
@@ -931,8 +931,8 @@ class POTemplate(SQLBase, RosettaStats):
             errors, warnings = translation_importer.importFile(
                 entry_to_import, logger)
         except (MixedNewlineMarkersError, TranslationFormatSyntaxError,
-                TranslationFormatInvalidInputError, UnicodeDecodeError) as (
-                exception):
+                TranslationFormatInvalidInputError,
+                UnicodeDecodeError) as exception:
             if logger:
                 logger.info(
                     'We got an error importing %s', self.title, exc_info=1)