Minor code cleanup.

This commit is contained in:
Raymond Hettinger 2014-11-28 14:52:14 -08:00
parent 73866efc34
commit 0badfd5989
1 changed files with 1 additions and 4 deletions

View File

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