summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
diff options
context:
space:
mode:
authoridomic <michael.ido@gmail.com>2020-03-09 11:57:53 (GMT)
committerGitHub <noreply@github.com>2020-03-09 11:57:53 (GMT)
commitfc72ab6913f2b5337ae7fda711f2de846d38f479 (patch)
tree2978bd3e0b166854e13690f9acc376d442f0df64 /Lib/importlib
parente53a3932cb01683b0fa8a7448ca25a2e658c39e6 (diff)
downloadcpython-fc72ab6913f2b5337ae7fda711f2de846d38f479.zip
cpython-fc72ab6913f2b5337ae7fda711f2de846d38f479.tar.gz
cpython-fc72ab6913f2b5337ae7fda711f2de846d38f479.tar.bz2
bpo-38691: importlib ignores PYTHONCASEOK if -E is used (GH-18627)
The importlib module now ignores the PYTHONCASEOK environment variable when the -E or -I command line options are being used.
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap_external.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index 2434cf0..7353bf9 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -34,8 +34,8 @@ def _make_relax_case():
key = b'PYTHONCASEOK'
def _relax_case():
- """True if filenames must be checked case-insensitively."""
- return key in _os.environ
+ """True if filenames must be checked case-insensitively and ignore environment flags are not set."""
+ return not sys.flags.ignore_environment and key in _os.environ
else:
def _relax_case():
"""True if filenames must be checked case-insensitively."""