Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix assert error when virtual path shares a common prefix with real p…
…ath. If (real) Python is installed at (say) `/opt/python2.7.3` and you have a virtualenv at `/opt/python`, `change_prefix()` will try to split off `/opt/python` from a path like `/opt/python2.7.3/lib/python2.7/distutils`, leaving `2.7.3/lib/python2.7/distutils`, which is not valid and fails the assert. This patch sorts the list of prefixes by length, so the longer path is tried before its prefix.
- Loading branch information