diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-04-20 16:11:37 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-04-20 16:11:37 (GMT) |
commit | c9f5ca232acccf412ef14aa294afd9deef4af93d (patch) | |
tree | 2f8c4fc6557eda239a3e05231fc739db0c9d8e6a /Lib/xml/etree/ElementTree.py | |
parent | 3bdead1113d6d6e5e998152167e8b1faa82580c1 (diff) | |
download | cpython-c9f5ca232acccf412ef14aa294afd9deef4af93d.zip cpython-c9f5ca232acccf412ef14aa294afd9deef4af93d.tar.gz cpython-c9f5ca232acccf412ef14aa294afd9deef4af93d.tar.bz2 |
Remove superfluous try/except
Diffstat (limited to 'Lib/xml/etree/ElementTree.py')
-rw-r--r-- | Lib/xml/etree/ElementTree.py | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index caa0087..b56ddff 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -1504,18 +1504,12 @@ class XMLParser: append = event_list.append for event in events: if event == "start": - try: - parser.ordered_attributes = 1 - parser.specified_attributes = 1 - def handler(tag, attrib_in, event=event, append=append, - start=self._start_list): - append((event, start(tag, attrib_in))) - parser.StartElementHandler = handler - except AttributeError: - def handler(tag, attrib_in, event=event, append=append, - start=self._start): - append((event, start(tag, attrib_in))) - parser.StartElementHandler = handler + parser.ordered_attributes = 1 + parser.specified_attributes = 1 + def handler(tag, attrib_in, event=event, append=append, + start=self._start_list): + append((event, start(tag, attrib_in))) + parser.StartElementHandler = handler elif event == "end": def handler(tag, event=event, append=append, end=self._end): |