Skip to content

Commit b015d7a

Browse files
author
James Graham
committed
Use right class when cloning nodes in lxml, fix issue 178
1 parent 5440177 commit b015d7a

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

html5lib/tests/test_parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ def testFunc(self, innerHTML=innerHTML, input=input,
142142
setattr(TestCase, testFunc.__name__,
143143
testFunc)
144144
break
145-
break
146145

147146
return unittest.TestLoader().loadTestsFromTestCase(TestCase)
148147

html5lib/treebuilders/etree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def insertText(self, data, insertBefore=None):
131131
self._element.text += data
132132

133133
def cloneNode(self):
134-
element = Element(self.name, self.namespace)
134+
element = type(self)(self.name, self.namespace)
135135
for name, value in self.attributes.iteritems():
136136
element.attributes[name] = value
137137
return element

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy