Avoid lxml deprecation warning
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 03 Nov 2016 18:29:02 +0100
changeset 1960 a7ea5df9e886
parent 1959 e12e9e564de0
child 1961 c6614962180f
Avoid lxml deprecation warning
entities/profile_generation.py
--- a/entities/profile_generation.py	Thu Nov 03 18:28:45 2016 +0100
+++ b/entities/profile_generation.py	Thu Nov 03 18:29:02 2016 +0100
@@ -680,7 +680,7 @@
             if hasattr(value, 'id'):
                 profile_element.attrib[self.qname('a:defaultValue')] = fixed_value
             else:
-                if (profile_element
+                if (len(profile_element)
                         and profile_element[-1].tag == '{http://relaxng.org/ns/structure/1.0}data'):
                     xstype = profile_element[-1].attrib.get('type')
                     profile_element.remove(profile_element[-1])