Minor code cleanup.
This commit is contained in:
parent
73866efc34
commit
0badfd5989
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue