Merge "bare excepts, as is proper"

This commit is contained in:
Jenkins 2013-11-27 01:57:28 +00:00 committed by Gerrit Code Review
commit fa8eef4b3f
2 changed files with 2 additions and 9 deletions

View File

@ -150,10 +150,7 @@ class MemcacheConnPool(Pool):
if self.current_size <= self.max_size: if self.current_size <= self.max_size:
try: try:
created = self.create() created = self.create()
# This was really supposed to be "except:" but ran afoul of the except: # noqa
# H201 check, which does not implement the "noqa" exception. Once
# that's fixed, the except here can be changed to "except: # noqa"
except (Exception, BaseException):
self.current_size -= 1 self.current_size -= 1
raise raise
return created return created

View File

@ -444,11 +444,7 @@ class TestMemcached(unittest.TestCase):
while not got: while not got:
try: try:
got = pool.get() got = pool.get()
# This was really supposed to be "except:" but ran afoul except: # noqa
# of the H201 check, which does not implement the "noqa"
# exception. Once that's fixed, the except here can be
# changed to "except: # noqa"
except (Exception, BaseException):
pass pass
pool.put(got) pool.put(got)