summaryrefslogtreecommitdiffstats
path: root/Lib/importlib/_bootstrap_external.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2016-07-15 18:54:38 (GMT)
committerBrett Cannon <brett@python.org>2016-07-15 18:54:38 (GMT)
commita47a7a5bf88c72d85f322f528381ebfa924072e9 (patch)
treea2581d2ef9a3909a320df6de9a9134bb91c3f3d1 /Lib/importlib/_bootstrap_external.py
parentf76457e12203d301c94e33957ff7121a24856b83 (diff)
downloadcpython-a47a7a5bf88c72d85f322f528381ebfa924072e9.zip
cpython-a47a7a5bf88c72d85f322f528381ebfa924072e9.tar.gz
cpython-a47a7a5bf88c72d85f322f528381ebfa924072e9.tar.bz2
Issue #27083: Respect the PYTHONCASEOK environment variable under
Windows. Originally only b'PYTHONCASEOK' was being checked for in os.environ, but that won't work under Windows where all environment variables are strings (on OS X they are bytes). Thanks to Eryk Sun for the bug report.
Diffstat (limited to 'Lib/importlib/_bootstrap_external.py')
-rw-r--r--Lib/importlib/_bootstrap_external.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/importlib/_bootstrap_external.py b/Lib/importlib/_bootstrap_external.py
index 08ddb2b..6e2ddb5 100644
--- a/Lib/importlib/_bootstrap_external.py
+++ b/Lib/importlib/_bootstrap_external.py
@@ -29,7 +29,8 @@ def _make_relax_case():
if sys.platform.startswith(_CASE_INSENSITIVE_PLATFORMS):
def _relax_case():
"""True if filenames must be checked case-insensitively."""
- return b'PYTHONCASEOK' in _os.environ
+ return (b'PYTHONCASEOK' in _os.environ
+ or 'PYTHONCASEOK' in _os.environ)
else:
def _relax_case():
"""True if filenames must be checked case-insensitively."""