function checkPyLauncher (errorCallback) {
    this.log.verbose(
      `- executing "${this.pyLauncher}" to get Python 2 executable path`)
    this.run(this.pyLauncher, ['-2', ...this.argsExecutable], false,
             function (err, execPath) {
      // Possible outcomes: same as checkCommand
      if (err) {
        this.addLog(
          `- "${this.pyLauncher}" is not in PATH or produced an error`)
        return errorCallback(err)
      }
      this.addLog(`- executable path is "${execPath}"`)
      this.checkExecPath(execPath, errorCallback)
    }.bind(this))
  }
function checkPyLauncher (errorCallback) {
    this.log.verbose(
      `- executing "${this.pyLauncher}" to get Python 2 executable path`)
    this.run(this.pyLauncher, ['-2', ...this.argsExecutable], false,
             function (err, execPath) {
      // Possible outcomes: same as checkCommand
      if (err) {
        this.addLog(
          `- "${this.pyLauncher}" is not in PATH or produced an error`)
        return errorCallback(err)
      }
      this.addLog(`- executable path is "${execPath}"`)
      this.checkExecPath(execPath, errorCallback)
    }.bind(this))
  }
function checkPyLauncher ( errorCallback ) { this . log . verbose ( ` ${ this . pyLauncher } ` ) this . run ( this . pyLauncher , [ '-2' , ... this . argsExecutable ] , false , function ( err , execPath ) { // Possible outcomes: same as checkCommand if ( err ) { this . addLog ( ` ${ this . pyLauncher } ` ) return errorCallback ( err ) } this . addLog ( ` ${ execPath } ` ) this . checkExecPath ( execPath , errorCallback ) } . bind ( this ) ) }
Check if the py launcher can find a valid Python to use. Will exit the Python finder on success. Distributions of Python on Windows by default install with the "py.exe" Python launcher which is more likely to exist than the Python executable being in the $PATH. Because the Python launcher supports all versions of Python, we have to explicitly request a Python 2 version. This is done by supplying "-2" as the first command line argument. Since "py.exe -2" would be an invalid executable for "execFile", we have to use the launcher to figure out where the actual "python.exe" executable is located.
Check if the py launcher can find a valid Python to use . Will exit the Python finder on success . Distributions of Python on Windows by default install with the py . exe Python launcher which is more likely to exist than the Python executable being in the $PATH . Because the Python launcher supports all versions of Python we have to explicitly request a Python 2 version . This is done by supplying - 2 as the first command line argument . Since py . exe - 2 would be an invalid executable for execFile we have to use the launcher to figure out where the actual python . exe executable is located .
Check the Python 2 executable path