summaryrefslogtreecommitdiff
path: root/Lib/xml
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2014-11-28 14:52:14 -0800
committerRaymond Hettinger <python@rcn.com>2014-11-28 14:52:14 -0800
commit0badfd598944edabf7294c320bc5a526aeacb6e3 (patch)
treecb262d1b796d87b647a05675a25af54e0f3cd400 /Lib/xml
parent73866efc34c9d4365ac4f4b93f08b1b0853ba5fb (diff)
downloadcpython-git-0badfd598944edabf7294c320bc5a526aeacb6e3.tar.gz
Minor code cleanup.
Diffstat (limited to 'Lib/xml')
-rw-r--r--Lib/xml/etree/ElementPath.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/xml/etree/ElementPath.py b/Lib/xml/etree/ElementPath.py
index 4b4d8cff84..5de42324c2 100644
--- a/Lib/xml/etree/ElementPath.py
+++ b/Lib/xml/etree/ElementPath.py
@@ -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.