Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0badfd5

Browse files
committed
Minor code cleanup.
1 parent 73866ef commit 0badfd5

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

Lib/xml/etree/ElementPath.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,7 @@ def iterfind(elem, path, namespaces=None):
295295
# Find first matching object.
296296

297297
def find(elem, path, namespaces=None):
298-
try:
299-
return next(iterfind(elem, path, namespaces))
300-
except StopIteration:
301-
return None
298+
return next(iterfind(elem, path, namespaces), None)
302299

303300
##
304301
# Find all matching objects.

0 commit comments

Comments
 (0)