1
0
Эх сурвалжийг харах

Don't use isinstance(root, ET.Element) as ET.Element is a function in Python 2.6

Guillaume Ayoub 14 жил өмнө
parent
commit
080e4984aa
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      radicale/xmlutils.py

+ 1 - 1
radicale/xmlutils.py

@@ -126,7 +126,7 @@ def name_from_path(path, calendar):
 def props_from_request(root, actions=("set", "remove")):
     """Return a list of properties as a dictionary."""
     result = OrderedDict()
-    if not isinstance(root, ET.Element):
+    if not hasattr(root, "tag"):
         root = ET.fromstring(root.encode("utf8"))
 
     for action in actions: