From: Florent Xicluna Date: Sat, 7 Jul 2012 11:16:44 +0000 (+0200) Subject: Minor refactoring in xml.etree.ElementTree doctype parser. X-Git-Tag: v3.3.0b2~307 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1c974a66de33b6439e970fbd6fab3a485ec96cc;p=thirdparty%2FPython%2Fcpython.git Minor refactoring in xml.etree.ElementTree doctype parser. --- diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index d30a83c92aff..61fe1550355d 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -1597,13 +1597,13 @@ class XMLParser: type = self._doctype[1] if type == "PUBLIC" and n == 4: name, type, pubid, system = self._doctype + if pubid: + pubid = pubid[1:-1] elif type == "SYSTEM" and n == 3: name, type, system = self._doctype pubid = None else: return - if pubid: - pubid = pubid[1:-1] if hasattr(self.target, "doctype"): self.target.doctype(name, pubid, system[1:-1]) elif self.doctype != self._XMLParser__doctype: