@@ -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