summaryrefslogtreecommitdiff
path: root/Lib/xmllib.py
diff options
context:
space:
mode:
authorSjoerd Mullender <sjoerd@acm.org>2001-03-14 17:03:30 +0000
committerSjoerd Mullender <sjoerd@acm.org>2001-03-14 17:03:30 +0000
commit538453e1554166053786d35329edd0000d24f10d (patch)
treed9f864d67dc200a1067f097f0684a6a73baeacb8 /Lib/xmllib.py
parent62dfed96beb1572134b6165a032cfbaa3882f2f3 (diff)
downloadcpython-git-538453e1554166053786d35329edd0000d24f10d.tar.gz
Moved clearing of "literal" flag. The flag is set in setliteral which
can be called from a start tag handler. When the corresponding end tag is read the flag is cleared. However, it didn't get cleared when the start tag was for an empty element of the type <tag .../>. This modification fixes the problem.
Diffstat (limited to 'Lib/xmllib.py')
-rw-r--r--Lib/xmllib.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/xmllib.py b/Lib/xmllib.py
index 23f9cdcc9b..e8210e6177 100644
--- a/Lib/xmllib.py
+++ b/Lib/xmllib.py
@@ -691,7 +691,6 @@ class XMLParser:
if not self.stack or tag != self.stack[-1][0]:
self.handle_data(rawdata[i])
return i+1
- self.literal = 0
k = res.end(0)
if endbracket.match(rawdata, k) is None:
self.syntax_error('garbage in end tag')
@@ -707,6 +706,7 @@ class XMLParser:
# Internal -- finish processing of end tag
def finish_endtag(self, tag):
+ self.literal = 0
if not tag:
self.syntax_error('name-less end tag')
found = len(self.stack) - 1