diff --git a/lib/galaxy/util/__init__.py b/lib/galaxy/util/__init__.py index c45285715b1..f581f8a4aed 100644 --- a/lib/galaxy/util/__init__.py +++ b/lib/galaxy/util/__init__.py @@ -50,9 +50,11 @@ from boltons.iterutils import ( LXML_AVAILABLE = True try: from lxml import etree + Element = etree._Element except ImportError: LXML_AVAILABLE = False import xml.etree.ElementTree as etree # type: ignore[assignment,no-redef] + Element = etree.Element from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry diff --git a/lib/galaxy/util/xml_macros.py b/lib/galaxy/util/xml_macros.py index 42c6680d71d..c55ce64d56f 100644 --- a/lib/galaxy/util/xml_macros.py +++ b/lib/galaxy/util/xml_macros.py @@ -2,7 +2,10 @@ import os from copy import deepcopy from typing import Dict, List -from galaxy.util import parse_xml +from galaxy.util import ( + Element, + parse_xml, +) REQUIRED_PARAMETER = object() @@ -20,7 +23,7 @@ def load_with_references(path): if macros_el is None: return tree, [] - macros: Dict[str, List[XmlMacroDef]] = {} + macros: Dict[str, List[Element]] = {} macro_paths = _import_macros(macros_el, path, macros) macros_el.clear()