]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Changed minidom.py to work correctly with new-style classes (since
authorAlex Martelli <aleaxit@gmail.com>
Mon, 21 Aug 2006 19:53:20 +0000 (19:53 +0000)
committerAlex Martelli <aleaxit@gmail.com>
Mon, 21 Aug 2006 19:53:20 +0000 (19:53 +0000)
there are no other kinds of classes in Py3K).

Lib/xml/dom/minidom.py

index 1a3b74f8ccb44656c6aec60fc1dcf0547c2787f6..028e809ca3267988990d317b296203d87b3a0c59 100644 (file)
@@ -359,6 +359,8 @@ class Attr(Node):
         # nodeValue and value are set elsewhere
 
     def _get_localName(self):
+        if 'localName' in self.__dict__:
+          return self.__dict__['localName']
         return self.nodeName.split(":", 1)[-1]
 
     def _get_name(self):
@@ -662,6 +664,8 @@ class Element(Node):
                            # namespaces.
 
     def _get_localName(self):
+        if 'localName' in self.__dict__:
+          return self.__dict__['localName']
         return self.tagName.split(":", 1)[-1]
 
     def _get_tagName(self):
@@ -1118,7 +1122,7 @@ def _get_containing_entref(node):
     return None
 
 
-class Comment(Childless, CharacterData):
+class Comment(CharacterData):
     nodeType = Node.COMMENT_NODE
     nodeName = "#comment"