← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~lifeless/launchpad/test into lp:launchpad/devel

 

Robert Collins has proposed merging lp:~lifeless/launchpad/test into lp:launchpad/devel.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)


remove some bare excepts.
-- 
https://code.launchpad.net/~lifeless/launchpad/test/+merge/35224
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~lifeless/launchpad/test into lp:launchpad/devel.
=== modified file 'lib/canonical/launchpad/doc/textsearching.txt'
--- lib/canonical/launchpad/doc/textsearching.txt	2010-08-02 02:33:53 +0000
+++ lib/canonical/launchpad/doc/textsearching.txt	2010-09-12 11:46:47 +0000
@@ -128,7 +128,7 @@
     ...     try:
     ...         cur.execute("SELECT _ftq(%s), ftq(%s)", (query, query))
     ...         uncompiled, compiled = cur.fetchone()
-    ...     except:
+    ...     except Exception:
     ...         SQLBase._connection._connection.rollback()
     ...         raise
     ...     if uncompiled is not None:

=== modified file 'lib/canonical/launchpad/scripts/ftests/raiseexception.py'
--- lib/canonical/launchpad/scripts/ftests/raiseexception.py	2010-08-20 20:31:18 +0000
+++ lib/canonical/launchpad/scripts/ftests/raiseexception.py	2010-09-12 11:46:47 +0000
@@ -29,7 +29,7 @@
     print >> sys.stderr, 'Script Output'
     try:
         raise RuntimeError('Aargh')
-    except:
+    except RuntimeError:
         log.exception('Oops')
         root_log.exception('Root oops')
 

=== modified file 'lib/canonical/launchpad/webapp/errorlog.py'
--- lib/canonical/launchpad/webapp/errorlog.py	2010-09-04 20:18:39 +0000
+++ lib/canonical/launchpad/webapp/errorlog.py	2010-09-12 11:46:47 +0000
@@ -507,7 +507,7 @@
             # We disable the pylint warning for the blank except.
             try:
                 raise info[0], info[1], traceback
-            except:
+            except info[0]:
                 logging.getLogger('SiteError').exception(
                     '%s (%s)' % (url, oopsid))
 

=== modified file 'lib/canonical/launchpad/webapp/interfaces.py'
--- lib/canonical/launchpad/webapp/interfaces.py	2010-08-24 16:44:42 +0000
+++ lib/canonical/launchpad/webapp/interfaces.py	2010-09-12 11:46:47 +0000
@@ -876,7 +876,7 @@
 
 try:
     from zope.publisher.interfaces import StartRequestEvent
-except:
+except ImportError:
     class IStartRequestEvent(Interface):
         """An event that gets sent before the start of a request."""
 

=== modified file 'lib/canonical/launchpad/webapp/publication.py'
--- lib/canonical/launchpad/webapp/publication.py	2010-08-20 20:31:18 +0000
+++ lib/canonical/launchpad/webapp/publication.py	2010-09-12 11:46:47 +0000
@@ -246,7 +246,7 @@
         threadrequestfile = open('thread-%s.request' % threadid, 'w')
         try:
             request_txt = unicode(request).encode('UTF-8')
-        except:
+        except Exception:
             request_txt = 'Exception converting request to string\n\n'
             try:
                 request_txt += traceback.format_exc()

=== modified file 'lib/canonical/testing/ftests/test_mockdb.py'
--- lib/canonical/testing/ftests/test_mockdb.py	2010-01-11 18:06:23 +0000
+++ lib/canonical/testing/ftests/test_mockdb.py	2010-09-12 11:46:47 +0000
@@ -42,7 +42,7 @@
         for con in self.connections:
             try:
                 con.close()
-            except:
+            except Exception:
                 pass
         self.connections = []
 

=== modified file 'lib/canonical/testing/layers.py'
--- lib/canonical/testing/layers.py	2010-09-06 09:41:01 +0000
+++ lib/canonical/testing/layers.py	2010-09-12 11:46:47 +0000
@@ -413,11 +413,10 @@
         """
         test_result = BaseLayer.getCurrentTestResult()
         if test_result.wasSuccessful():
-            # pylint: disable-msg=W0702
             test_case = BaseLayer.getCurrentTestCase()
             try:
                 raise LayerIsolationError(message)
-            except:
+            except LayerIsolationError:
                 test_result.addError(test_case, sys.exc_info())
 
     @classmethod

=== modified file 'lib/lp/testing/menu.py'
--- lib/lp/testing/menu.py	2010-08-23 04:07:24 +0000
+++ lib/lp/testing/menu.py	2010-09-12 11:46:47 +0000
@@ -22,6 +22,6 @@
             view_name = None
         try:
             canonical_url(context, view_name=view_name, rootsite=link.site)
-        except:
+        except Exception:
             return 'Bad link %s: %s' % (link.name, canonical_url(context))
     return True


Follow ups