mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
Remove superfluous try/except
This commit is contained in:
parent
3bdead1113
commit
c9f5ca232a
1 changed files with 6 additions and 12 deletions
|
@ -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):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue