Remove superfluous try/except

This commit is contained in:
Eli Bendersky 2013-04-20 09:11:37 -07:00
parent 3bdead1113
commit c9f5ca232a

View file

@ -1504,18 +1504,12 @@ class XMLParser:
append = event_list.append append = event_list.append
for event in events: for event in events:
if event == "start": if event == "start":
try:
parser.ordered_attributes = 1 parser.ordered_attributes = 1
parser.specified_attributes = 1 parser.specified_attributes = 1
def handler(tag, attrib_in, event=event, append=append, def handler(tag, attrib_in, event=event, append=append,
start=self._start_list): start=self._start_list):
append((event, start(tag, attrib_in))) append((event, start(tag, attrib_in)))
parser.StartElementHandler = handler 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
elif event == "end": elif event == "end":
def handler(tag, event=event, append=append, def handler(tag, event=event, append=append,
end=self._end): end=self._end):