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

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: e9734f97cbd60f712fce647efc9729b48b3402e8
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-except-parens
Merge into: launchpad:master
Diff against target: 30 lines (+4/-4)
2 files modified
lib/lp/translations/model/pofile.py (+2/-2)
lib/lp/translations/model/potemplate.py (+2/-2)
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+379669@code.launchpad.net

Commit message

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

Description of the change

Splitting the exception target onto a new line with parentheses worked in Python 2, but is a syntax error in Python 3.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
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):
983 entry_to_import.setErrorOutput(983 entry_to_import.setErrorOutput(
984 "File was not exported from Launchpad.")984 "File was not exported from Launchpad.")
985 except (MixedNewlineMarkersError, TranslationFormatSyntaxError,985 except (MixedNewlineMarkersError, TranslationFormatSyntaxError,
986 TranslationFormatInvalidInputError, UnicodeDecodeError) as (986 TranslationFormatInvalidInputError,
987 exception):987 UnicodeDecodeError) as exception:
988 # The import failed with a format error. We log it and select the988 # The import failed with a format error. We log it and select the
989 # email template.989 # email template.
990 if logger:990 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):
931 errors, warnings = translation_importer.importFile(931 errors, warnings = translation_importer.importFile(
932 entry_to_import, logger)932 entry_to_import, logger)
933 except (MixedNewlineMarkersError, TranslationFormatSyntaxError,933 except (MixedNewlineMarkersError, TranslationFormatSyntaxError,
934 TranslationFormatInvalidInputError, UnicodeDecodeError) as (934 TranslationFormatInvalidInputError,
935 exception):935 UnicodeDecodeError) as exception:
936 if logger:936 if logger:
937 logger.info(937 logger.info(
938 'We got an error importing %s', self.title, exc_info=1)938 'We got an error importing %s', self.title, exc_info=1)

Subscribers

People subscribed via source and target branches

to status/vote changes: