From c628d93a80d0c75c7fdb40261ffc9d5fe7807cba Mon Sep 17 00:00:00 2001
From: Aparna Jyothi <aparnajyothi-y@github.com>
Date: Wed, 19 Feb 2025 13:24:53 +0530
Subject: [PATCH] update the logic

---
 dist/setup/index.js | 2 +-
 src/find-python.ts  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dist/setup/index.js b/dist/setup/index.js
index ec17336f..e303bf05 100644
--- a/dist/setup/index.js
+++ b/dist/setup/index.js
@@ -99609,7 +99609,7 @@ function useCpythonVersion(version, architecture, updateEnvironment, checkLatest
                 const version = path.basename(path.dirname(installDir));
                 const major = semver.major(version);
                 const minor = semver.minor(version);
-                if (parseFloat(version) >= 3.10 && architecture !== 'x64') {
+                if ((major > 3 || (major === 3 && minor >= 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)
diff --git a/src/find-python.ts b/src/find-python.ts
index 0558177a..a859e1e5 100644
--- a/src/find-python.ts
+++ b/src/find-python.ts
@@ -139,7 +139,7 @@ export async function useCpythonVersion(
       const major = semver.major(version);
       const minor = semver.minor(version);
 
-      if (parseFloat(version) >= 3.10 && architecture !== 'x64') {
+      if ((major > 3 || (major === 3 && minor >= 10)) && architecture !== 'x64') {
         // For Python >= 3.10 and architecture!= 'x64', add the architecture-specific folder to the path
         const arch = architecture === '32';