fix deprecation warning

if macros copy is actually an `Element` then this gives a deprecation
warning:

xml_macros.py:41: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
  if macros_copy:
This commit is contained in:
Matthias Bernt
2022-01-19 15:08:25 +01:00
parent 72141b34e6
commit a216858e27
+1 -1
View File
@@ -38,7 +38,7 @@ def load_with_references(path):
# readd the stashed children of the macros node
# TODO is this this really necesary? Since macro nodes are removed anyway just below.
if macros_copy:
if macros_copy is not None:
_xml_set_children(macros_el, list(macros_copy))
for el in root.xpath('//macro'):