Kaydet (Commit) c9f5ca23 authored tarafından Eli Bendersky's avatar Eli Bendersky

Remove superfluous try/except

üst 3bdead11
...@@ -1504,18 +1504,12 @@ class XMLParser: ...@@ -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):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment