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:
Christian Heimes 2018-09-24 19:21:12 +02:00 committed by Miss Islington (bot)
parent a46467ff19
commit 223e501fb9
3 changed files with 7 additions and 2 deletions

View file

@ -58,7 +58,7 @@ if _false:
import xml.sax.expatreader
import os, sys
if "PY_SAX_PARSER" in os.environ:
if not sys.flags.ignore_environment and "PY_SAX_PARSER" in os.environ:
default_parser_list = os.environ["PY_SAX_PARSER"].split(",")
del os