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
1diff --git a/lib/lp/translations/model/pofile.py b/lib/lp/translations/model/pofile.py
2index c490f64..01187aa 100644
3--- a/lib/lp/translations/model/pofile.py
4+++ b/lib/lp/translations/model/pofile.py
5@@ -983,8 +983,8 @@ class POFile(SQLBase, POFileMixIn):
6 entry_to_import.setErrorOutput(
7 "File was not exported from Launchpad.")
8 except (MixedNewlineMarkersError, TranslationFormatSyntaxError,
9- TranslationFormatInvalidInputError, UnicodeDecodeError) as (
10- exception):
11+ TranslationFormatInvalidInputError,
12+ UnicodeDecodeError) as exception:
13 # The import failed with a format error. We log it and select the
14 # email template.
15 if logger:
16diff --git a/lib/lp/translations/model/potemplate.py b/lib/lp/translations/model/potemplate.py
17index f30c186..ba0a632 100644
18--- a/lib/lp/translations/model/potemplate.py
19+++ b/lib/lp/translations/model/potemplate.py
20@@ -931,8 +931,8 @@ class POTemplate(SQLBase, RosettaStats):
21 errors, warnings = translation_importer.importFile(
22 entry_to_import, logger)
23 except (MixedNewlineMarkersError, TranslationFormatSyntaxError,
24- TranslationFormatInvalidInputError, UnicodeDecodeError) as (
25- exception):
26+ TranslationFormatInvalidInputError,
27+ UnicodeDecodeError) as exception:
28 if logger:
29 logger.info(
30 'We got an error importing %s', self.title, exc_info=1)

Subscribers

People subscribed via source and target branches

to status/vote changes: