← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:except-no-nested-tuples into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:except-no-nested-tuples into launchpad:master.

Commit message:
Avoid except with nested tuples

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

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

The previous construction doesn't work in Python 3.  See https://bugs.python.org/issue42669.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:except-no-nested-tuples into launchpad:master.
diff --git a/lib/lp/app/widgets/launchpadtarget.py b/lib/lp/app/widgets/launchpadtarget.py
index 89b2a95..00f0b37 100644
--- a/lib/lp/app/widgets/launchpadtarget.py
+++ b/lib/lp/app/widgets/launchpadtarget.py
@@ -107,7 +107,9 @@ class LaunchpadTargetWidget(BrowserWidget, InputWidget):
         try:
             self.getInputValue()
             return True
-        except (InputErrors, UnexpectedFormData):
+        except InputErrors:
+            return False
+        except UnexpectedFormData:
             return False
 
     def getInputValue(self):
diff --git a/lib/lp/app/widgets/project.py b/lib/lp/app/widgets/project.py
index 6329b56..9eb1f8d 100644
--- a/lib/lp/app/widgets/project.py
+++ b/lib/lp/app/widgets/project.py
@@ -77,7 +77,9 @@ class ProjectScopeWidget(BrowserWidget, InputWidget):
         try:
             self.getInputValue()
             return self.hasInput()
-        except (InputErrors, UnexpectedFormData, LaunchpadValidationError):
+        except InputErrors:
+            return False
+        except (UnexpectedFormData, LaunchpadValidationError):
             return False
 
     def getInputValue(self):
diff --git a/lib/lp/code/browser/widgets/branchtarget.py b/lib/lp/code/browser/widgets/branchtarget.py
index 77e479a..9eb06f1 100644
--- a/lib/lp/code/browser/widgets/branchtarget.py
+++ b/lib/lp/code/browser/widgets/branchtarget.py
@@ -78,7 +78,9 @@ class BranchTargetWidget(BrowserWidget, InputWidget):
         try:
             self.getInputValue()
             return True
-        except (InputErrors, UnexpectedFormData):
+        except InputErrors:
+            return False
+        except UnexpectedFormData:
             return False
 
     def getInputValue(self):
diff --git a/lib/lp/code/browser/widgets/gitgrantee.py b/lib/lp/code/browser/widgets/gitgrantee.py
index 4cb8a8a..3720cf0 100644
--- a/lib/lp/code/browser/widgets/gitgrantee.py
+++ b/lib/lp/code/browser/widgets/gitgrantee.py
@@ -207,7 +207,9 @@ class GitGranteeWidget(GitGranteeWidgetBase, InputWidget):
         try:
             self.getInputValue()
             return True
-        except (InputErrors, UnexpectedFormData):
+        except InputErrors:
+            return False
+        except UnexpectedFormData:
             return False
 
     def getInputValue(self):
diff --git a/lib/lp/code/browser/widgets/gitref.py b/lib/lp/code/browser/widgets/gitref.py
index b4acd01..cbe203d 100644
--- a/lib/lp/code/browser/widgets/gitref.py
+++ b/lib/lp/code/browser/widgets/gitref.py
@@ -156,7 +156,9 @@ class GitRefWidget(BrowserWidget, InputWidget):
         try:
             self.getInputValue()
             return True
-        except (InputErrors, UnexpectedFormData):
+        except InputErrors:
+            return False
+        except UnexpectedFormData:
             return False
 
     def getInputValue(self):
diff --git a/lib/lp/code/browser/widgets/gitrepositorytarget.py b/lib/lp/code/browser/widgets/gitrepositorytarget.py
index 63e9285..52c7461 100644
--- a/lib/lp/code/browser/widgets/gitrepositorytarget.py
+++ b/lib/lp/code/browser/widgets/gitrepositorytarget.py
@@ -154,7 +154,9 @@ class GitRepositoryTargetWidget(GitRepositoryTargetWidgetBase, InputWidget):
         try:
             self.getInputValue()
             return True
-        except (InputErrors, UnexpectedFormData):
+        except InputErrors:
+            return False
+        except UnexpectedFormData:
             return False
 
     def getInputValue(self):
diff --git a/lib/lp/snappy/browser/widgets/snaparchive.py b/lib/lp/snappy/browser/widgets/snaparchive.py
index fadd621..67a9a6a 100644
--- a/lib/lp/snappy/browser/widgets/snaparchive.py
+++ b/lib/lp/snappy/browser/widgets/snaparchive.py
@@ -104,7 +104,9 @@ class SnapArchiveWidget(BrowserWidget, InputWidget):
         try:
             self.getInputValue()
             return True
-        except (InputErrors, UnexpectedFormData):
+        except InputErrors:
+            return False
+        except UnexpectedFormData:
             return False
 
     def getInputValue(self):
diff --git a/lib/lp/snappy/browser/widgets/snapbuildchannels.py b/lib/lp/snappy/browser/widgets/snapbuildchannels.py
index 8a9b67a..e73d1ce 100644
--- a/lib/lp/snappy/browser/widgets/snapbuildchannels.py
+++ b/lib/lp/snappy/browser/widgets/snapbuildchannels.py
@@ -92,7 +92,9 @@ class SnapBuildChannelsWidget(BrowserWidget, InputWidget):
         try:
             self.getInputValue()
             return True
-        except (InputErrors, UnexpectedFormData):
+        except InputErrors:
+            return False
+        except UnexpectedFormData:
             return False
 
     def getInputValue(self):
diff --git a/lib/lp/snappy/browser/widgets/storechannels.py b/lib/lp/snappy/browser/widgets/storechannels.py
index 0e3e211..5190f40 100644
--- a/lib/lp/snappy/browser/widgets/storechannels.py
+++ b/lib/lp/snappy/browser/widgets/storechannels.py
@@ -142,7 +142,9 @@ class StoreChannelsWidget(BrowserWidget, InputWidget):
         try:
             self.getInputValue()
             return True
-        except (InputErrors, UnexpectedFormData):
+        except InputErrors:
+            return False
+        except UnexpectedFormData:
             return False
 
     def getInputValue(self):