| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,8 @@ | |||
| 6 | 6 | # should be published by posting to xml-sig@python.org, and are | |
| 7 | 7 | # subsequently recorded in this file. | |
| 8 | 8 | ||
| 9 | + import sys | ||
| 10 | + | ||
| 9 | 11 | well_known_implementations = { | |
| 10 | 12 | 'minidom':'xml.dom.minidom', | |
| 11 | 13 | '4DOM': 'xml.dom.DOMImplementation', | |
@@ -55,7 +57,7 @@ def getDOMImplementation(name=None, features=()): | |||
| 55 | 57 | return mod.getDOMImplementation() | |
| 56 | 58 | elif name: | |
| 57 | 59 | return registered[name]() | |
| 58 | - elif "PYTHON_DOM" in os.environ: | ||
| 60 | + elif not sys.flags.ignore_environment and "PYTHON_DOM" in os.environ: | ||
| 59 | 61 | return getDOMImplementation(name = os.environ["PYTHON_DOM"]) | |
| 60 | 62 | ||
| 61 | 63 | # User did not specify a name, try implementations in arbitrary | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,7 +58,7 @@ def parseString(string, handler, errorHandler=ErrorHandler()): | |||
| 58 | 58 | import xml.sax.expatreader | |
| 59 | 59 | ||
| 60 | 60 | import os, sys | |
| 61 | - if "PY_SAX_PARSER" in os.environ: | ||
| 61 | + if not sys.flags.ignore_environment and "PY_SAX_PARSER" in os.environ: | ||
| 62 | 62 | default_parser_list = os.environ["PY_SAX_PARSER"].split(",") | |
| 63 | 63 | del os | |
| 64 | 64 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + The xml.sax and xml.dom.domreg no longer use environment variables to | ||
| 2 | + override parser implementations when sys.flags.ignore_environment is set by | ||
| 3 | + -E or -I arguments. | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments