]> granicus.if.org Git - python/commitdiff
Minor refactoring in xml.etree.ElementTree doctype parser.
authorFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 7 Jul 2012 11:16:44 +0000 (13:16 +0200)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Sat, 7 Jul 2012 11:16:44 +0000 (13:16 +0200)
Lib/xml/etree/ElementTree.py

index d30a83c92aff93917c62354edbff48c7854359e9..61fe1550355dafc14e24620546056398ec546559 100644 (file)
@@ -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: