@@ -51,8 +51,11 @@ function binDir(installDir: string): string {
51
51
// A particular version of PyPy may contain one or more versions of the Python interpreter.
52
52
// For example, PyPy 7.0 contains Python 2.7, 3.5, and 3.6-alpha.
53
53
// 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 ) ;
56
59
let installDir : string | null = findPyPy ( architecture ) ;
57
60
58
61
if ( ! installDir && IS_WINDOWS ) {
@@ -186,9 +189,10 @@ export async function findPythonVersion(
186
189
) : Promise < InstalledVersion > {
187
190
switch ( version . toUpperCase ( ) ) {
188
191
case 'PYPY2' :
189
- return usePyPy ( 2 , architecture ) ;
192
+ return usePyPy ( '2' , architecture ) ;
190
193
case 'PYPY3' :
191
- return usePyPy ( 3 , architecture ) ;
194
+ // keep pypy3 pointing to 3.6 for backward compatibility
195
+ return usePyPy ( '3.6' , architecture ) ;
192
196
default :
193
197
return await useCpythonVersion ( version , architecture ) ;
194
198
}
0 commit comments