]> granicus.if.org Git - python/commitdiff
Minor code cleanup.
authorRaymond Hettinger <python@rcn.com>
Fri, 28 Nov 2014 22:52:14 +0000 (14:52 -0800)
committerRaymond Hettinger <python@rcn.com>
Fri, 28 Nov 2014 22:52:14 +0000 (14:52 -0800)
Lib/xml/etree/ElementPath.py

index 4b4d8cff84fb59b9614fe6e9c2ca2cddc4df04e7..5de42324c29598e41039e815edab297e2815541f 100644 (file)
@@ -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.