Skip to content

Commit 76ca7ba

Browse files
sthibaulmgorse
authored andcommitted
Fix creating dom nodes
Python 3.13 introduced a fix python/cpython#142146 which brought a regression python/cpython#142754 Discussion shows that one is not supposed to use Element to create nodes. It used to work but is not really supported. They fixed the issue in https://github.com/python/cpython/pull/142794/files but better create dom nodes the proper way with doc.createElement. collectiontest.py didn't actually need to create elements any more.
1 parent 445d64b commit 76ca7ba

2 files changed

Lines changed: 1 addition & 13 deletions

File tree

tests/pyatspi/accessibletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
pyatspi.STATE_VERTICAL,]
3737

3838
def _createNode(doc, accessible, parentElement):
39-
e = minidom.Element("accessible")
39+
e = doc.createElement("accessible")
4040

4141
nameA = doc.createAttribute('name')
4242
roleA = doc.createAttribute('role')

tests/pyatspi/collectiontest.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,6 @@
3535
pyatspi.STATE_SUPPORTS_AUTOCOMPLETION,
3636
pyatspi.STATE_VERTICAL,]
3737

38-
def _createNode(accessible, parentElement):
39-
e = minidom.Element("accessible")
40-
41-
e.attributes["name"] = accessible.name
42-
e.attributes["role"] = str(int(accessible.getRole()))
43-
e.attributes["description"] = accessible.description
44-
45-
for i in range(0, accessible.childCount):
46-
_createNode(accessible.getChildAtIndex(i), e)
47-
48-
parentElement.appendChild(e)
49-
5038
class AccessibleTest(_PasyTest):
5139

5240
__tests__ = ["setup",

0 commit comments

Comments
 (0)