commit | 0badfd598944edabf7294c320bc5a526aeacb6e3 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Fri Nov 28 14:52:14 2014 -0800 |
committer | Raymond Hettinger <python@rcn.com> | Fri Nov 28 14:52:14 2014 -0800 |
tree | cb262d1b796d87b647a05675a25af54e0f3cd400 | |
parent | 73866efc34c9d4365ac4f4b93f08b1b0853ba5fb [diff] |
Minor code cleanup.
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 @@ # 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.