Explorar el Código

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

Guillaume Ayoub hace 14 años
padre
commit
080e4984aa
Se han modificado 1 ficheros con 1 adiciones y 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: