[meld/meld-3-20] vc.svn: Update xml.etree API usage for Python 3.9 (#526)



commit ffdebca569e634a15e4accf95cbdee4eec01ce95
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Mon Nov 16 07:36:14 2020 +1000

    vc.svn: Update xml.etree API usage for Python 3.9 (#526)
    
    The previous `getchildren()` API has been deprecated since 3.2,
    and has been removed in 3.9. We're replacing it here with a
    tag-filtering helper API to make our lives easier.

 meld/vc/svn.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/meld/vc/svn.py b/meld/vc/svn.py
index 8b9e58be..b812868a 100644
--- a/meld/vc/svn.py
+++ b/meld/vc/svn.py
@@ -185,14 +185,13 @@ class Vc(_vc.Vc):
                     raise
 
         for target in tree.findall("target") + tree.findall("changelist"):
-            for entry in (t for t in target.getchildren() if t.tag == "entry"):
+            for entry in target.iter(tag="entry"):
                 path = entry.attrib["path"]
                 if not path:
                     continue
                 if not os.path.isabs(path):
                     path = os.path.abspath(os.path.join(self.location, path))
-                for status in (e for e in entry.getchildren()
-                               if e.tag == "wc-status"):
+                for status in entry.iter(tag="wc-status"):
                     item = status.attrib["item"]
                     if item == "":
                         continue


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]