Commit 53ed6944 authored by Guido van Rossum's avatar Guido van Rossum

- Unshare namespaceDict only when we're actually storing into it.

- Lose redundant semicolon.
parent 951f4ca4
...@@ -131,9 +131,9 @@ class METALCompiler(DOMVisitor): ...@@ -131,9 +131,9 @@ class METALCompiler(DOMVisitor):
self.namespaceDict = self.namespaceStack.pop() self.namespaceDict = self.namespaceStack.pop()
def newNS(self, prefix, namespaceURI): def newNS(self, prefix, namespaceURI):
if self.namespaceDict is self.namespaceStack[-1]:
self.namespaceDict = self.namespaceDict.copy()
if self.namespaceDict.get(prefix) != namespaceURI: if self.namespaceDict.get(prefix) != namespaceURI:
if self.namespaceDict is self.namespaceStack[-1]:
self.namespaceDict = self.namespaceDict.copy()
self.namespaceDict[prefix] = namespaceURI self.namespaceDict[prefix] = namespaceURI
return 1 return 1
else: else:
...@@ -255,7 +255,7 @@ class TALCompiler(METALCompiler): ...@@ -255,7 +255,7 @@ class TALCompiler(METALCompiler):
# Overriding METAL method to add attribute replacements # Overriding METAL method to add attribute replacements
def getAttributeList(self, node): def getAttributeList(self, node):
attrList = METALCompiler.getAttributeList(self, node); attrList = METALCompiler.getAttributeList(self, node)
attrDict = getAttributeReplacements(node) attrDict = getAttributeReplacements(node)
if not attrDict: if not attrDict:
return attrList return attrList
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment