diff options
author | Matt Iversen <teh.ivo@gmail.com> | 2016-01-30 08:45:51 +1100 |
---|---|---|
committer | Matt Iversen <teh.ivo@gmail.com> | 2016-01-30 08:45:51 +1100 |
commit | e263dd673e4559048eea948417cb2a0714a01aa4 (patch) | |
tree | 314a678dc4f6d55f1b39ddd868b34f883842dc80 /virtualenv.py | |
parent | 351d2f499bdcb58020318db935344fe2adba52a6 (diff) | |
download | virtualenv-e263dd673e4559048eea948417cb2a0714a01aa4.tar.gz |
Revert ac4ea65; only correct drive letter case.
Fixes #856, #815
Diffstat (limited to 'virtualenv.py')
-rwxr-xr-x | virtualenv.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/virtualenv.py b/virtualenv.py index c8148f5..8fb53f6 100755 --- a/virtualenv.py +++ b/virtualenv.py @@ -975,10 +975,12 @@ def change_prefix(filename, dst_prefix): prefixes.append(sys.base_prefix) prefixes = list(map(os.path.expanduser, prefixes)) prefixes = list(map(os.path.abspath, prefixes)) - prefixes = list(map(os.path.normcase, prefixes)) # Check longer prefixes first so we don't split in the middle of a filename prefixes = sorted(prefixes, key=len, reverse=True) - filename = os.path.normcase(os.path.abspath(filename)) + filename = os.path.abspath(filename) + # On Windows, make sure drive letter is uppercase + if is_win and filename[0] in 'abcdefghijklmnopqrstuvwxyz': + filename = filename[0].upper() + filename[1:] for src_prefix in prefixes: if filename.startswith(src_prefix): _, relpath = filename.split(src_prefix, 1) |