Skip to content

Commit

Permalink
Update xml2xsc.iterpath() to work with current Python versions.
Browse files Browse the repository at this point in the history
The method `getchildren()` was removed in Python 3.9.
  • Loading branch information
doerwalter committed Apr 26, 2023
1 parent 9ae8761 commit 5de927a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ of XIST. For a description of how to update your code to each versions of XIST
see :ref:`MIGRATION`.


Changes in HEAD (released 2023-??-??)
-------------------------------------

* Replace a check for the ElementTree method :meth:`getchildren` with a check
for :meth:`findall` in :func:`xml2xsc.iterpath` since :meth:`getchildren`
has been removed in Python 3.9.


Changes in 5.74 (released 2023-03-01)
-------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion src/ll/xist/scripts/xml2xsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def iterpath(node):
yield [node]
if hasattr(node, "text") and node.text:
yield [node, node.text]
if hasattr(node, "getchildren"):
if hasattr(node, "findall"):
for child in node:
for path in iterpath(child):
yield [node] + path
Expand Down

0 comments on commit 5de927a

Please sign in to comment.