Mesa (staging/20.0): glapi: remove deprecated .getchildren() that has been replace with an iterator

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 9 18:01:49 UTC 2020


Module: Mesa
Branch: staging/20.0
Commit: 38dc311654d11f1a9d98b19f80a1cf2935442c99
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=38dc311654d11f1a9d98b19f80a1cf2935442c99

Author: Eric Engestrom <eric at engestrom.ch>
Date:   Fri Jun  5 01:05:46 2020 +0200

glapi: remove deprecated .getchildren() that has been replace with an iterator

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3086
Signed-off-by: Eric Engestrom <eric at engestrom.ch>
Reviewed-by: Vinson Lee <vlee at freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5342>
(cherry picked from commit 7a68045b5d3ca52ea9db6f4c2606ae16546187ea)

---

 .pick_status.json             | 2 +-
 src/mapi/glapi/gen/glX_XML.py | 4 ++--
 src/mapi/glapi/gen/gl_XML.py  | 8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 5b386012507..395a7615e33 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -814,7 +814,7 @@
         "description": "glapi: remove deprecated .getchildren() that has been replace with an iterator",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/mapi/glapi/gen/glX_XML.py b/src/mapi/glapi/gen/glX_XML.py
index ff0011bf9ce..3b54a967fdc 100644
--- a/src/mapi/glapi/gen/glX_XML.py
+++ b/src/mapi/glapi/gen/glX_XML.py
@@ -48,7 +48,7 @@ class glx_enum(gl_XML.gl_enum):
 
         self.functions = {}
 
-        for child in element.getchildren():
+        for child in element:
             if child.tag == "size":
                 n = child.get( "name" )
                 c = child.get( "count" )
@@ -130,7 +130,7 @@ class glx_function(gl_XML.gl_function):
                     self.counter_list.append(param.counter)
 
 
-        for child in element.getchildren():
+        for child in element:
             if child.tag == "glx":
                 rop = child.get( 'rop' )
                 sop = child.get( 'sop' )
diff --git a/src/mapi/glapi/gen/gl_XML.py b/src/mapi/glapi/gen/gl_XML.py
index 5b5f6e23b0a..1e8859c98a1 100644
--- a/src/mapi/glapi/gen/gl_XML.py
+++ b/src/mapi/glapi/gen/gl_XML.py
@@ -713,7 +713,7 @@ class gl_function( gl_item ):
 
         parameters = []
         return_type = "void"
-        for child in element.getchildren():
+        for child in element:
             if child.tag == "return":
                 return_type = child.get( "type", "void" )
             elif child.tag == "param":
@@ -743,7 +743,7 @@ class gl_function( gl_item ):
                 if param.is_image():
                     self.images.append( param )
 
-        if element.getchildren():
+        if list(element):
             self.initialized = 1
             self.entry_point_parameters[name] = parameters
         else:
@@ -873,7 +873,7 @@ class gl_api(object):
 
 
     def process_OpenGLAPI(self, file_name, element):
-        for child in element.getchildren():
+        for child in element:
             if child.tag == "category":
                 self.process_category( child )
             elif child.tag == "OpenGLAPI":
@@ -893,7 +893,7 @@ class gl_api(object):
         [cat_type, key] = classify_category(cat_name, cat_number)
         self.categories[cat_type][key] = [cat_name, cat_number]
 
-        for child in cat.getchildren():
+        for child in cat:
             if child.tag == "function":
                 func_name = real_function_name( child )
 



More information about the mesa-commit mailing list