1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
Forwarded: https://gitlab.gnome.org/GNOME/pyatspi2/-/merge_requests/38
commit a3cd123dc7b7b13dad380f18ea9c2eabcdfccaa7
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date: Wed Dec 17 15:58:18 2025 +0100
Fix creating dom nodes
Python 3.13 introduced a fix
https://github.com/python/cpython/pull/142146
which brought a regression
https://github.com/python/cpython/issues/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.
diff --git a/tests/pyatspi/accessibletest.py b/tests/pyatspi/accessibletest.py
index 930ad63..afe3e60 100644
--- a/tests/pyatspi/accessibletest.py
+++ b/tests/pyatspi/accessibletest.py
@@ -36,7 +36,7 @@ st = [pyatspi.STATE_MULTI_LINE,
pyatspi.STATE_VERTICAL,]
def _createNode(doc, accessible, parentElement):
- e = minidom.Element("accessible")
+ e = doc.createElement("accessible")
nameA = doc.createAttribute('name')
roleA = doc.createAttribute('role')
diff --git a/tests/pyatspi/collectiontest.py b/tests/pyatspi/collectiontest.py
index ee66bad..7f8e77c 100644
--- a/tests/pyatspi/collectiontest.py
+++ b/tests/pyatspi/collectiontest.py
@@ -35,18 +35,6 @@ st = [pyatspi.STATE_MULTI_LINE,
pyatspi.STATE_SUPPORTS_AUTOCOMPLETION,
pyatspi.STATE_VERTICAL,]
-def _createNode(accessible, parentElement):
- e = minidom.Element("accessible")
-
- e.attributes["name"] = accessible.name
- e.attributes["role"] = str(int(accessible.getRole()))
- e.attributes["description"] = accessible.description
-
- for i in range(0, accessible.childCount):
- _createNode(accessible.getChildAtIndex(i), e)
-
- parentElement.appendChild(e)
-
class AccessibleTest(_PasyTest):
__tests__ = ["setup",
|