Skip to content

Commit 73fc23e

Browse files
author
Kartik Raj
committed
Code reviews
1 parent 1461297 commit 73fc23e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/client/pythonEnvironments/common/pythonBinariesWatcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export function watchLocationForPythonBinaries(
1818
const patterns = [executablePattern, `*/${executablePattern}`, `*/${binName}/${executablePattern}`];
1919
for (const pattern of patterns) {
2020
watchLocationForPattern(baseDir, pattern, (type: FileChangeType, e: string) => {
21-
const isMatch = picomatch(executablePattern);
22-
if (!isMatch(path.basename(e))) {
21+
const regex = picomatch.toRegex(executablePattern, { nocase: getOSType() === OSType.Windows });
22+
if (!regex.test(path.basename(e))) {
2323
// When deleting the file for some reason path to all directories leading up to python are reported
2424
// Skip those events
2525
return;

src/client/pythonEnvironments/discovery/locators/services/windowsStoreLocator.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ const windowsPythonExes = 'python3\.[0-9]\.exe';
105105
* @returns {boolean} : Returns true if the path matches pattern for windows python executable.
106106
*/
107107
export function isWindowsStorePythonExe(interpreterPath: string): boolean {
108-
const isMatch = picomatch(windowsPythonExes);
109-
return isMatch(path.basename(interpreterPath));
108+
const regex = picomatch.toRegex(windowsPythonExes, { nocase: true });
109+
return regex.test(path.basename(interpreterPath));
110110
}
111111

112112
/**

0 commit comments

Comments
 (0)