Skip to content

Commit

Permalink
Fix tox gevent#49: Now any PythonX.Y on windows will be found at \pyt…
Browse files Browse the repository at this point in the history
…honXY\python.exe
  • Loading branch information
nedbat committed Sep 30, 2012
1 parent 167e214 commit b631618
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tox/_venv.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import with_statement
import sys, os
import sys, os, re
import py
import tox
from tox._config import DepConfig
Expand Down Expand Up @@ -317,21 +317,23 @@ def find_executable(name):
return py.path.local.sysfind(name)

else:
# Exceptions to the usual windows mapping
win32map = {
'python': sys.executable,
'python2.4': "c:\python24\python.exe",
'python2.5': "c:\python25\python.exe",
'python2.6': "c:\python26\python.exe",
'python2.7': "c:\python27\python.exe",
'python3.1': "c:\python31\python.exe",
'python3.2': "c:\python32\python.exe",
'jython': "c:\jython2.5.1\jython.bat",
}
def find_executable(name):
p = py.path.local(name)
if p.check(file=1):
return p
actual = win32map.get(name, None)
actual = None
# Is this a standard PythonX.Y name?
m = re.match(r"python(\d)\.(\d)", name)
if m:
# The standard names are in predictable places.
actual = r"c:\python%s%s\python.exe" % m.groups()
if not actual:
actual = win32map.get(name, None)
if actual:
actual = py.path.local(actual)
if actual.check():
Expand Down

0 comments on commit b631618

Please sign in to comment.