diff options
author | Raymond Hettinger <python@rcn.com> | 2014-11-28 22:52:14 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2014-11-28 22:52:14 (GMT) |
commit | 0badfd598944edabf7294c320bc5a526aeacb6e3 (patch) | |
tree | cb262d1b796d87b647a05675a25af54e0f3cd400 /Lib/xml | |
parent | 73866efc34c9d4365ac4f4b93f08b1b0853ba5fb (diff) | |
download | cpython-0badfd598944edabf7294c320bc5a526aeacb6e3.zip cpython-0badfd598944edabf7294c320bc5a526aeacb6e3.tar.gz cpython-0badfd598944edabf7294c320bc5a526aeacb6e3.tar.bz2 |
Minor code cleanup.
Diffstat (limited to 'Lib/xml')
-rw-r--r-- | Lib/xml/etree/ElementPath.py | 5 |
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. |