# Copyright (c) 2010-2019 openpyxl
"""Collection of XML resources compatible across different Python versions"""
from lxml.etree import LXML_VERSION
LXML = LXML_VERSION >= (3, 3, 1, 0)
if not LXML:
warnings.warn("The installed version of lxml is too old to be used with openpyxl")
return False # we have it, but too old
return True # we have it, and recent enough
return False # we don't even have it
return os.environ.get("OPENPYXL_LXML", "True") == "True"
LXML = lxml_available() and lxml_env_set()
import defusedxml # noqa
return os.environ.get("OPENPYXL_DEFUSEDXML", "True") == "True"
DEFUSEDXML = defusedxml_available() and defusedxml_env_set()