@@ -208,7 +208,7 @@ private void createAndUpload(){
208208    File  espota  = new  File (platform .getFolder ()+"/tools" );
209209    File  esptool  = new  File (platform .getFolder ()+"/tools" );
210210    String  serialPort  = PreferencesData .get ("serial.port" );
211-     String  pythonCmd  = PreferencesData .get ("runtime.os" ).contentEquals ("windows" ) ? "python .exe"  : "python " ;
211+     String  pythonCmd  = PreferencesData .get ("runtime.os" ).contentEquals ("windows" ) ? "python3 .exe"  : "python3 " ;
212212    String  uploadCmd  = "" ;
213213
214214    //make sure the serial port or IP is defined 
@@ -224,15 +224,15 @@ private void createAndUpload(){
224224      uploadCmd  = uploadPyFile .getAbsolutePath ();
225225    }
226226    // Find python.exe if present, don't fail if not found for backwards compat 
227-     String [] paths  = { platform .getFolder ()+"/tools" , platform .getFolder ()+"/tools/python " , PreferencesData .get ("runtime.tools.python .path" ) };
227+     String [] paths  = { platform .getFolder ()+"/tools" , platform .getFolder ()+"/tools/python3 " , PreferencesData .get ("runtime.tools.python3 .path" ) };
228228    for  (String  s : paths ) {
229229      File  toolPyFile  = new  File (s , pythonCmd );
230230      if  (toolPyFile .exists () && toolPyFile .isFile () && toolPyFile .canExecute ()) {
231231        pythonCmd  = toolPyFile .getAbsolutePath ();
232232        break ;
233233      }
234234    }
235-     // pythonCmd now points to either an installed exe with full path or just plain "python (.exe)" 
235+     // pythonCmd now points to either an installed exe with full path or just plain "python3 (.exe)" 
236236
237237    //find espota if IP else find esptool 
238238    if (serialPort .split ("\\ ." ).length  == 4 ){
@@ -331,7 +331,7 @@ private void createAndUpload(){
331331      }
332332      System .out .println ();
333333      if  (!uploadCmd .isEmpty ()) {
334-         sysExec (new  String []{pythonCmd , uploadCmd , "--chip" , "esp8266" , "--port" , serialPort , "--baud" , uploadSpeed , "write_flash" , uploadAddress , imagePath ,  "--end" });
334+         sysExec (new  String []{pythonCmd , uploadCmd , "--chip" , "esp8266" , "--port" , serialPort , "--baud" , uploadSpeed , "write_flash" , uploadAddress , imagePath });
335335      } else  {
336336        sysExec (new  String []{esptool .getAbsolutePath (), "-cd" , resetMethod , "-cb" , uploadSpeed , "-cp" , serialPort , "-ca" , uploadAddress , "-cf" , imagePath });
337337      }
0 commit comments