Minor code cleanup.

This commit is contained in:
Raymond Hettinger 2014-11-28 14:52:14 -08:00
parent 73866efc34
commit 0badfd5989

View file

@ -295,10 +295,7 @@ def iterfind(elem, path, namespaces=None):
# Find first matching object. # Find first matching object.
def find(elem, path, namespaces=None): def find(elem, path, namespaces=None):
try: return next(iterfind(elem, path, namespaces), None)
return next(iterfind(elem, path, namespaces))
except StopIteration:
return None
## ##
# Find all matching objects. # Find all matching objects.