From: Raymond Hettinger Date: Fri, 28 Nov 2014 22:52:14 +0000 (-0800) Subject: Minor code cleanup. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0badfd598944edabf7294c320bc5a526aeacb6e3;p=python Minor code cleanup. --- 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.