Skip to content

Commit b7dc030

Browse files
authored
Adding CPU architecture support on windows
Patches lookups via the Windows "py" launcher to also check for architecture when "-32" or "-64" is added to the end of a basepython value.
1 parent d6cd8d4 commit b7dc030

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/tox/interpreters.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,16 @@ def tox_get_python_executable(envconfig):
161161
return actual
162162
# Use py.exe to determine location - PEP-514 & PEP-397
163163
if m:
164-
return locate_via_py(*groups)
164+
archMatch = re.match(r"python(\d)(\.(\d))?(?P<arch>-(32|64))?", envconfig.basepython)
165+
arch = archMatch.group('arch')
166+
return locate_via_py(*groups, arch=arch)
165167

166168
# Exceptions to the usual windows mapping
167169
win32map = {"python": sys.executable, "jython": r"c:\jython2.5.1\jython.bat"}
168170

169-
def locate_via_py(*parts):
170-
ver = "-{}".format(".".join(parts))
171+
def locate_via_py(*parts, arch=None):
172+
173+
ver = "-{}{}".format(".".join(parts),(arch if arch is not None else ""))
171174
script = "import sys; print(sys.executable)"
172175
py_exe = distutils.spawn.find_executable("py")
173176
if py_exe:

0 commit comments

Comments
 (0)