summaryrefslogtreecommitdiffstats
path: root/Lib/xml/etree
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2012-03-05 10:42:49 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2012-03-05 10:42:49 (GMT)
commitfb06746852f8d84455e15fe8ba650e87fc37fe97 (patch)
tree63d462d3cbab660c09dc1046b3ff2f886bbb6229 /Lib/xml/etree
parent49ab14f4529e06ecd7d6804ea80f62ab6094a386 (diff)
downloadcpython-fb06746852f8d84455e15fe8ba650e87fc37fe97.zip
cpython-fb06746852f8d84455e15fe8ba650e87fc37fe97.tar.gz
cpython-fb06746852f8d84455e15fe8ba650e87fc37fe97.tar.bz2
Flatten nested try ... finally, try ... except.
Diffstat (limited to 'Lib/xml/etree')
-rw-r--r--Lib/xml/etree/ElementTree.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py
index 1a25f9a..10ee896 100644
--- a/Lib/xml/etree/ElementTree.py
+++ b/Lib/xml/etree/ElementTree.py
@@ -1674,12 +1674,11 @@ class XMLParser:
except self._error as v:
self._raiseerror(v)
try:
- try:
- close_handler = self.target.close
- except AttributeError:
- pass
- else:
- return close_handler()
+ close_handler = self.target.close
+ except AttributeError:
+ pass
+ else:
+ return close_handler()
finally:
# get rid of circular references
del self.parser, self._parser