8000 update dist file (#166) · simonw/setup-python@da8703f · GitHub
[go: up one dir, main page]

Skip to content

Commit da8703f

Browse files
update dist file (actions#166)
1 parent accf675 commit da8703f

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

dist/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6417,7 +6417,7 @@ function binDir(installDir) {
64176417
// For example, PyPy 7.0 contains Python 2.7, 3.5, and 3.6-alpha.
64186418
// We only care about the Python version, so we don't use the PyPy version for the tool cache.
64196419
function usePyPy(majorVersion, architecture) {
6420-
const findPyPy = tc.find.bind(undefined, 'PyPy', majorVersion.toString());
6420+
const findPyPy = tc.find.bind(undefined, 'PyPy', majorVersion);
64216421
let installDir = findPyPy(architecture);
64226422
if (!installDir && IS_WINDOWS) {
64236423
// PyPy only precompiles binaries for x86, but the architecture parameter defaults to x64.
@@ -6513,9 +6513,9 @@ function findPythonVersion(version, architecture) {
65136513
return __awaiter(this, void 0, void 0, function* () {
65146514
switch (version.toUpperCase()) {
65156515
case 'PYPY2':
6516-
return usePyPy(2, architecture);
6516+
return usePyPy('2', architecture);
65176517
case 'PYPY3':
6518-
return usePyPy(3, architecture);
6518+
return usePyPy('3.6', architecture);
65196519
default:
65206520
return yield useCpythonVersion(version, architecture);
65216521
}

src/find-python.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ function binDir(installDir: string): string {
5151
// A particular version of PyPy may contain one or more versions of the Python interpreter.
5252
// For example, PyPy 7.0 contains Python 2.7, 3.5, and 3.6-alpha.
5353
// We only care about the Python version, so we don't use the PyPy version for the tool cache.
54-
function usePyPy(majorVersion: 2 | 3, architecture: string): InstalledVersion {
55-
const findPyPy = tc.find.bind(undefined, 'PyPy', majorVersion.toString());
54+
function usePyPy(
55+
majorVersion: '2' | '3.6',
56+
architecture: string
57+
): InstalledVersion {
58+
const findPyPy = tc.find.bind(undefined, 'PyPy', majorVersion);
5659
let installDir: string | null = findPyPy(architecture);
5760

5861
if (!installDir && IS_WINDOWS) {
@@ -186,9 +189,10 @@ export async function findPythonVersion(
186189
): Promise<InstalledVersion> {
187190
switch (version.toUpperCase()) {
188191
case 'PYPY2':
189-
return usePyPy(2, architecture);
192+
return usePyPy('2', architecture);
190193
case 'PYPY3':
191-
return usePyPy(3, architecture);
194+
// keep pypy3 pointing to 3.6 for backward compatibility
195+
return usePyPy('3.6', architecture);
192196
default:
193197
return await useCpythonVersion(version, architecture);
194198
}

0 commit comments

Comments
 (0)
0