From 7ca63cb7cc0ea962f40559ba57f767e38d7f1af7 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Sat, 16 Jul 2016 10:44:13 -0700 Subject: Fix regressions introduced by fixes for issue #27083. --- Lib/importlib/_bootstrap_external.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Lib/importlib') diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py index 6e2ddb5b7d..e54d6916e8 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.""" -- cgit v1.2.1