Skip to content

Commit aedb7f4

Browse files
authored
Check for built-in Python executable first
Added logic to check for built-in Python executable before searching the system PATH.
1 parent 7dcf9c7 commit aedb7f4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/installer/stages/pioarduino-core.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,18 @@ export default class pioarduinoCoreStage extends BaseStage {
362362
}
363363

364364
do {
365+
// First try to find built-in Python if enabled
366+
if (this.params.useBuiltinPython) {
367+
try {
368+
const pythonPath = await pioarduinoCoreStage.findBuiltInPythonExe();
369+
await fs.access(pythonPath);
370+
console.info('Using built-in Python:', pythonPath);
371+
return pythonPath;
372+
} catch (err) {
373+
console.info('Built-in Python not found, searching system PATH');
374+
}
375+
}
376+
365377
const pythonExecutable = await findPythonExecutable();
366378
if (pythonExecutable) {
367379
return pythonExecutable;

0 commit comments

Comments
 (0)