| |
@@ -0,0 +1,31 @@
|
| |
+ diff --git a/virtualenv.py b/virtualenv.py
|
| |
+ index 3085d1d..b532cfd 100755
|
| |
+ --- a/virtualenv.py
|
| |
+ +++ b/virtualenv.py
|
| |
+ @@ -971,6 +971,17 @@ def filter_install_output(line):
|
| |
+ return Logger.DEBUG
|
| |
+
|
| |
+
|
| |
+ +def relaxed_int(text):
|
| |
+ + """Converts "10" to 10, "10a1" to 10, but fails with "a10"."""
|
| |
+ + try:
|
| |
+ + return int(text)
|
| |
+ + except ValueError as e:
|
| |
+ + try:
|
| |
+ + return int(re.search(r'^\d+', text).group())
|
| |
+ + except AttributeError: # NoneType object has no attribute group
|
| |
+ + raise e
|
| |
+ +
|
| |
+ +
|
| |
+ def find_wheels(projects, search_dirs):
|
| |
+ """Find wheels from which we can import PROJECTS.
|
| |
+
|
| |
+ @@ -992,7 +1003,7 @@ def find_wheels(projects, search_dirs):
|
| |
+ versions = list(
|
| |
+ reversed(
|
| |
+ sorted(
|
| |
+ - [(tuple(int(i) for i in os.path.basename(f).split("-")[1].split(".")), f) for f in files]
|
| |
+ + [(tuple(relaxed_int(i) for i in os.path.basename(f).split("-")[1].split(".")), f) for f in files]
|
| |
+ )
|
| |
+ )
|
| |
+ )
|
| |
Untested yet.