mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-34791: xml package obeys ignore env flags (GH-9544)
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
This commit is contained in:
parent
a46467ff19
commit
223e501fb9
3 changed files with 7 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue