Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a1c974a

Browse files
committed
Minor refactoring in xml.etree.ElementTree doctype parser.
1 parent fed2c51 commit a1c974a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/xml/etree/ElementTree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,13 +1597,13 @@ def _default(self, text):
15971597
type = self._doctype[1]
15981598
if type == "PUBLIC" and n == 4:
15991599
name, type, pubid, system = self._doctype
1600+
if pubid:
1601+
pubid = pubid[1:-1]
16001602
elif type == "SYSTEM" and n == 3:
16011603
name, type, system = self._doctype
16021604
pubid = None
16031605
else:
16041606
return
1605-
if pubid:
1606-
pubid = pubid[1:-1]
16071607
if hasattr(self.target, "doctype"):
16081608
self.target.doctype(name, pubid, system[1:-1])
16091609
elif self.doctype != self._XMLParser__doctype:

0 commit comments

Comments
 (0)