Simplify existence checks

This commit is contained in:
Joshua Harlow
2013-05-20 11:40:49 -07:00
parent 93b12023e2
commit 7fa37fd3c7

View File

@@ -156,11 +156,9 @@ class MemoryLogBook(logbook.LogBook):
@check_not_closed
def __contains__(self, flow_name):
try:
self[flow_name]
return True
except exc.NotFound:
if flow_name not in self._flow_names:
return False
return True
def __delitem__(self, flow_name):
w = self[flow_name]