Explorar o código

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

Guillaume Ayoub %!s(int64=14) %!d(string=hai) anos
pai
achega
080e4984aa
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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: