summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2002-04-10 04:20:33 (GMT)
committerFred Drake <fdrake@acm.org>2002-04-10 04:20:33 (GMT)
commit3c1ff5c766191389a05153370f5217c1b71bdc08 (patch)
tree1faf7fa2e136de06f2995d96066c6c8bf0e6c115 /Doc
parent0047e16d1bd5d9447ab03545b574c337ea81d80b (diff)
downloadcpython-3c1ff5c766191389a05153370f5217c1b71bdc08.zip
cpython-3c1ff5c766191389a05153370f5217c1b71bdc08.tar.gz
cpython-3c1ff5c766191389a05153370f5217c1b71bdc08.tar.bz2
When adding a name to the table of macros and environments, make sure it
is not already present. If it is, raise an exception, since that should not happen in a well-defined conversion.
Diffstat (limited to 'Doc')
-rwxr-xr-xDoc/tools/sgmlconv/latex2esis.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/tools/sgmlconv/latex2esis.py b/Doc/tools/sgmlconv/latex2esis.py
index 38b6e49..3ccd7e7 100755
--- a/Doc/tools/sgmlconv/latex2esis.py
+++ b/Doc/tools/sgmlconv/latex2esis.py
@@ -487,7 +487,10 @@ class TableHandler(xml.sax.handler.ContentHandler):
if attrs.has_key("outputname"):
self.__current.outputname = attrs.get("outputname")
def end_macro(self):
- self.__table[self.__current.name] = self.__current
+ name = self.__current.name
+ if self.__table.has_key(name):
+ raise ValueError("name %s already in use" % `name`)
+ self.__table[name] = self.__current
self.__current = None
def start_attribute(self, attrs):