From 36d972e1c6227ffd8aaad347ee3b8dc37dec425f Mon Sep 17 00:00:00 2001 From: paulober <44974737+paulober@users.noreply.github.com> Date: Wed, 11 Sep 2024 17:21:20 +0100 Subject: [PATCH] Fix python selection Signed-off-by: paulober <44974737+paulober@users.noreply.github.com> --- src/webview/newMicroPythonProjectPanel.mts | 4 +++- web/mpy/main.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/webview/newMicroPythonProjectPanel.mts b/src/webview/newMicroPythonProjectPanel.mts index 3e13f77..1c296b5 100644 --- a/src/webview/newMicroPythonProjectPanel.mts +++ b/src/webview/newMicroPythonProjectPanel.mts @@ -276,7 +276,9 @@ export class NewMicroPythonProjectPanel { let python3Path: string | undefined; if (process.platform === "darwin" || process.platform === "win32") { switch (data.pythonMode) { - // TODO: add a simpler option, maybe to select via python extension api + case 0: + python3Path = data.pythonPath; + break; case 1: python3Path = process.platform === "win32" ? "python" : "python3"; break; diff --git a/web/mpy/main.js b/web/mpy/main.js index 2acf3f0..5633131 100644 --- a/web/mpy/main.js +++ b/web/mpy/main.js @@ -81,7 +81,7 @@ var submitted = false; let pythonPath = null; for (let i = 0; i < pythonVersionRadio.length; i++) { if (pythonVersionRadio[i].checked) { - pythonMode = pythonVersionRadio[i].value; + pythonMode = Number(pythonVersionRadio[i].value); break; } }