mirror of
https://github.com/python/cpython.git
synced 2025-08-29 13:15:11 +00:00
Minor code cleanup.
This commit is contained in:
parent
73866efc34
commit
0badfd5989
1 changed files with 1 additions and 4 deletions
|
@ -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.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue