Kaydet (Commit) 0badfd59 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Minor code cleanup.

üst 73866efc
...@@ -295,10 +295,7 @@ def iterfind(elem, path, namespaces=None): ...@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment