소스 검색

More deprecation fixes

xmlutils.py:116: DeprecationWarning: This method will be removed in future
                 versions.  Use 'list(elem)' or iteration over elem instead.
prop_list = prop_element.getchildren()
Lukasz Langa 15 년 전
부모
커밋
0d8fa5db6b
1개의 변경된 파일4개의 추가작업 그리고 7개의 파일을 삭제
  1. 4 7
      radicale/xmlutils.py

+ 4 - 7
radicale/xmlutils.py

@@ -113,9 +113,8 @@ def propfind(path, xml_request, calendar, depth):
     root = ET.fromstring(xml_request)
 
     prop_element = root.find(_tag("D", "prop"))
-    prop_list = prop_element.getchildren()
-    props = [prop.tag for prop in prop_list]
-    
+    props = [prop.tag for prop in prop_element]
+
     # Writing answer
     multistatus = ET.Element(_tag("D", "multistatus"))
 
@@ -222,8 +221,7 @@ def proppatch(path, xml_request, calendar):
         action_element = root.find(_tag("D", action))
         if action_element is not None:
             prop_element = action_element.find(_tag("D", "prop"))
-            prop_list = prop_element.getchildren()
-            props.extend(prop.tag for prop in prop_list)
+            props.extend(prop.tag for prop in prop_element)
 
     # Writing answer
     multistatus = ET.Element(_tag("D", "multistatus"))
@@ -276,8 +274,7 @@ def report(path, xml_request, calendar):
     root = ET.fromstring(xml_request)
 
     prop_element = root.find(_tag("D", "prop"))
-    prop_list = prop_element.getchildren()
-    props = [prop.tag for prop in prop_list]
+    props = [prop.tag for prop in prop_element]
 
     if calendar:
         if root.tag == _tag("C", "calendar-multiget"):