summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2014-11-28 22:52:14 (GMT)
committerRaymond Hettinger <python@rcn.com>2014-11-28 22:52:14 (GMT)
commit0badfd598944edabf7294c320bc5a526aeacb6e3 (patch)
treecb262d1b796d87b647a05675a25af54e0f3cd400
parent73866efc34c9d4365ac4f4b93f08b1b0853ba5fb (diff)
downloadcpython-0badfd598944edabf7294c320bc5a526aeacb6e3.zip
cpython-0badfd598944edabf7294c320bc5a526aeacb6e3.tar.gz
cpython-0badfd598944edabf7294c320bc5a526aeacb6e3.tar.bz2
Minor code cleanup.
-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 4b4d8cf..5de4232 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.