Fix use of for-else with no break
authorHugh Brown <hbrown@amplify.com>
Thu, 10 Oct 2013 23:04:20 +0000 (19:04 -0400)
committerHugh Brown <hbrown@amplify.com>
Thu, 10 Oct 2013 23:32:14 +0000 (19:32 -0400)
jenkinsapi/views.py

index 4926f5b..6a751e5 100644 (file)
@@ -48,12 +48,7 @@ class Views(object):
     def __getitem__(self, view_name):
         for row in self.jenkins._data.get('views', []):
             if row['name'] == view_name:
-                return View(
-                    row['url'],
-                    row['name'],
-                    self.jenkins)
-        else:
-            return None
+                return View(row['url'], row['name'], self.jenkins)
 
     def iteritems(self):
         """