diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2018-10-19 16:09:23 -0700 |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2018-10-20 01:09:23 +0200 |
commit | 5e808f92ea4eb238b17757526b99f97debf7dd57 (patch) | |
tree | 17a0df0cce72c3b7b539fc9ad8337ea130f77e14 /Lib/xml/dom/domreg.py | |
parent | 47413fe608c8ecea3b8c4c6341442fd4174160c6 (diff) | |
download | cpython-git-5e808f92ea4eb238b17757526b99f97debf7dd57.tar.gz |
bpo-34791: xml package obeys ignore env flags (GH-9544) (GH-9546)
The xml.sax and xml.dom.domreg modules now obey
sys.flags.ignore_environment.
Signed-off-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue34791
(cherry picked from commit 223e501fb9c2b6ae21b96054e20c4c31d94a5d96)
Co-authored-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Lib/xml/dom/domreg.py')
-rw-r--r-- | Lib/xml/dom/domreg.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/xml/dom/domreg.py b/Lib/xml/dom/domreg.py index 8c3d901acb..69c17eebb2 100644 --- a/Lib/xml/dom/domreg.py +++ b/Lib/xml/dom/domreg.py @@ -6,6 +6,8 @@ registerDOMImplementation should be imported from xml.dom.""" # should be published by posting to xml-sig@python.org, and are # subsequently recorded in this file. +import sys + well_known_implementations = { 'minidom':'xml.dom.minidom', '4DOM': 'xml.dom.DOMImplementation', @@ -55,7 +57,7 @@ def getDOMImplementation(name=None, features=()): return mod.getDOMImplementation() elif name: return registered[name]() - elif "PYTHON_DOM" in os.environ: + elif not sys.flags.ignore_environment and "PYTHON_DOM" in os.environ: return getDOMImplementation(name = os.environ["PYTHON_DOM"]) # User did not specify a name, try implementations in arbitrary |