Skip to content

Commit 34b4a9a

Browse files
committed
paths
1 parent cdafe7c commit 34b4a9a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/managers/common/nativePythonFinder.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,15 @@ function getPythonSettingAndUntildify<T>(name: string, scope?: Uri): T | undefin
671671
return value;
672672
}
673673

674+
/**
675+
* Cross-platform check for absolute paths.
676+
* Uses both current platform's check and Windows-specific check to handle
677+
* Windows paths (e.g., C:\path) when running on Unix systems.
678+
*/
679+
function isAbsolutePath(inputPath: string): boolean {
680+
return path.isAbsolute(inputPath) || path.win32.isAbsolute(inputPath);
681+
}
682+
674683
/**
675684
* Gets all extra environment search paths from various configuration sources.
676685
* Combines legacy python settings (with migration), globalSearchPaths, and workspaceSearchPaths.
@@ -702,7 +711,7 @@ export async function getAllExtraSearchPaths(): Promise<string[]> {
702711

703712
const trimmedPath = searchPath.trim();
704713

705-
if (path.isAbsolute(trimmedPath)) {
714+
if (isAbsolutePath(trimmedPath)) {
706715
// Absolute path - use as is
707716
searchDirectories.push(trimmedPath);
708717
} else {

0 commit comments

Comments
 (0)