mirror of https://github.com/python/cpython.git
Minor refactoring in xml.etree.ElementTree doctype parser.
This commit is contained in:
parent
fed2c51eea
commit
a1c974a66d
|
@ -1597,13 +1597,13 @@ def _default(self, text):
|
||||||
type = self._doctype[1]
|
type = self._doctype[1]
|
||||||
if type == "PUBLIC" and n == 4:
|
if type == "PUBLIC" and n == 4:
|
||||||
name, type, pubid, system = self._doctype
|
name, type, pubid, system = self._doctype
|
||||||
|
if pubid:
|
||||||
|
pubid = pubid[1:-1]
|
||||||
elif type == "SYSTEM" and n == 3:
|
elif type == "SYSTEM" and n == 3:
|
||||||
name, type, system = self._doctype
|
name, type, system = self._doctype
|
||||||
pubid = None
|
pubid = None
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
if pubid:
|
|
||||||
pubid = pubid[1:-1]
|
|
||||||
if hasattr(self.target, "doctype"):
|
if hasattr(self.target, "doctype"):
|
||||||
self.target.doctype(name, pubid, system[1:-1])
|
self.target.doctype(name, pubid, system[1:-1])
|
||||||
elif self.doctype != self._XMLParser__doctype:
|
elif self.doctype != self._XMLParser__doctype:
|
||||||
|
|
Loading…
Reference in New Issue