From 1140d87ee460203d0b8ef8047f1c0028a4f31f18 Mon Sep 17 00:00:00 2001 From: Aparna Jyothi Date: Wed, 19 Feb 2025 13:18:07 +0530 Subject: [PATCH] update the logic --- dist/setup/index.js | 5 +++-- src/find-python.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index d46c09fc..ec17336f 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -99609,8 +99609,9 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest const version = path.basename(path.dirname(installDir)); const major = semver.major(version); const minor = semver.minor(version); - if (major >= 3 && (major > 3 || minor >= 10)) { - const arch = architecture === 'x64' ? '64' : '32'; + if (parseFloat(version) >= 3.10 && architecture !== 'x64') { + // For Python >= 3.10 and architecture!= 'x64', add the architecture-specific folder to the path + const arch = architecture === '32'; const userScriptsDir = path.join(process.env['APPDATA'] || '', 'Python', `Python${major}${minor}-${arch}`, // Add architecture-specific folder (e.g., Python310-64 or Python310-32) 'Scripts'); // Add the dynamically constructed path to the environment PATH variable diff --git a/src/find-python.ts b/src/find-python.ts index cee7a07e..0558177a 100644 --- a/src/find-python.ts +++ b/src/find-python.ts @@ -139,8 +139,9 @@ export async function useCpythonVersion( const major = semver.major(version); const minor = semver.minor(version); - if (major >= 3 && (major > 3 || minor >= 10)) { - const arch = architecture === 'x64' ? '64' : '32'; + if (parseFloat(version) >= 3.10 && architecture !== 'x64') { + // For Python >= 3.10 and architecture!= 'x64', add the architecture-specific folder to the path + const arch = architecture === '32'; const userScriptsDir = path.join( process.env['APPDATA'] || '',