diff options
author | idomic <michael.ido@gmail.com> | 2020-03-09 11:57:53 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-09 11:57:53 (GMT) |
commit | fc72ab6913f2b5337ae7fda711f2de846d38f479 (patch) | |
tree | 2978bd3e0b166854e13690f9acc376d442f0df64 /Lib/importlib | |
parent | e53a3932cb01683b0fa8a7448ca25a2e658c39e6 (diff) | |
download | cpython-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.py | 4 |
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.""" |