From a216858e2767265a30499a7b5a1018fdfd3a787d Mon Sep 17 00:00:00 2001 From: Matthias Bernt Date: Wed, 19 Jan 2022 15:08:25 +0100 Subject: [PATCH] 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: --- lib/galaxy/util/xml_macros.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/galaxy/util/xml_macros.py b/lib/galaxy/util/xml_macros.py index 2aedd71ea51..24883e96f2c 100644 --- a/lib/galaxy/util/xml_macros.py +++ b/lib/galaxy/util/xml_macros.py @@ -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'):