Skip to content

Commit

Permalink
Merge pull request #320 from jkleint/develop
Browse files Browse the repository at this point in the history
Fix assert error when virtual path shares a common prefix with real path
  • Loading branch information
pnasrat committed Oct 19, 2012
2 parents 4cd1a4d + 82b894d commit 98b8160
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,8 @@ 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))
# 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.abspath(filename)
for src_prefix in prefixes:
if filename.startswith(src_prefix):
Expand Down

0 comments on commit 98b8160

Please sign in to comment.