aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2016-07-16 10:45:16 -0700
committerBrett Cannon <brett@python.org>2016-07-16 10:45:16 -0700
commit4106f61c4c60a0d981b16aca08daa89cdd07a29b (patch)
treefd542246d2e8c18e58f552792df7e36a1ef6a7ae /Lib/importlib
parentIssue #27285: Cleanup leftover susp-ignored entry after text was changed (diff)
parentFix regressions introduced by fixes for issue #27083. (diff)
downloadcpython-4106f61c4c60a0d981b16aca08daa89cdd07a29b.tar.gz
cpython-4106f61c4c60a0d981b16aca08daa89cdd07a29b.tar.bz2
cpython-4106f61c4c60a0d981b16aca08daa89cdd07a29b.zip
Merge for #27083
Diffstat (limited to 'Lib/importlib')
-rw-r--r--Lib/importlib/_bootstrap_external.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index d332237e597..46f1bab19b4 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -21,16 +21,22 @@ work. One should use importlib as the public-facing version of this module.
# anything specified at the class level.
# Bootstrap-related code ######################################################
-
-_CASE_INSENSITIVE_PLATFORMS = 'win', 'cygwin', 'darwin'
+_CASE_INSENSITIVE_PLATFORMS_STR_KEY = 'win',
+_CASE_INSENSITIVE_PLATFORMS_BYTES_KEY = 'cygwin', 'darwin'
+_CASE_INSENSITIVE_PLATFORMS = (_CASE_INSENSITIVE_PLATFORMS_BYTES_KEY
+ + _CASE_INSENSITIVE_PLATFORMS_STR_KEY)
def _make_relax_case():
if sys.platform.startswith(_CASE_INSENSITIVE_PLATFORMS):
+ if sys.platform.startswith(_CASE_INSENSITIVE_PLATFORMS_STR_KEY):
+ key = 'PYTHONCASEOK'
+ else:
+ key = b'PYTHONCASEOK'
+
def _relax_case():
"""True if filenames must be checked case-insensitively."""
- return (b'PYTHONCASEOK' in _os.environ
- or 'PYTHONCASEOK' in _os.environ)
+ return key in _os.environ
else:
def _relax_case():
"""True if filenames must be checked case-insensitively."""