DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).

Sun, 10 Mar 2019 18:17:54 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 10 Mar 2019 18:17:54 +0100
changeset 6848
7682182a0f0f
parent 6847
5150e076014b
child 6850
2728fed832cd

DebuggerInterfacePython: search common extensions on Windows platforms for the remote execution program (e.g. entered ssh will result in ssh.exe).

Debugger/DebuggerInterfacePython.py file | annotate | diff | comparison | revisions
--- a/Debugger/DebuggerInterfacePython.py	Sun Mar 10 15:05:44 2019 +0100
+++ b/Debugger/DebuggerInterfacePython.py	Sun Mar 10 18:17:54 2019 +0100
@@ -228,7 +228,15 @@
                 args = Utilities.parseOptionString(rexec) + \
                     [rhost, interpreter, debugClient,
                         noencoding, str(port), redirect, ipaddr]
-                args[0] = Utilities.getExecutablePath(args[0])
+                if Utilities.isWindowsPlatform():
+                    if not os.path.splitext(args[0])[1]:
+                        for ext in [".exe", ".com", ".cmd", ".bat"]:
+                            prog = Utilities.getExecutablePath(args[0] + ext)
+                            if prog:
+                                args[0] = prog
+                                break
+                else:
+                    args[0] = Utilities.getExecutablePath(args[0])
                 process = self.__startProcess(args[0], args[1:],
                                               workingDir=workingDir)
                 if process is None:
@@ -381,7 +389,15 @@
                 args = Utilities.parseOptionString(rexec) + \
                     [rhost, interpreter, debugClient, noencoding,
                      str(port), redirect, ipaddr]
-                args[0] = Utilities.getExecutablePath(args[0])
+                if Utilities.isWindowsPlatform():
+                    if not os.path.splitext(args[0])[1]:
+                        for ext in [".exe", ".com", ".cmd", ".bat"]:
+                            prog = Utilities.getExecutablePath(args[0] + ext)
+                            if prog:
+                                args[0] = prog
+                                break
+                else:
+                    args[0] = Utilities.getExecutablePath(args[0])
                 process = self.__startProcess(args[0], args[1:],
                                               workingDir=workingDir)
                 if process is None:

eric ide

mercurial