Skip to content

Commit

Permalink
Partially revert "Go back to using python instead of python3 and …
Browse files Browse the repository at this point in the history
…bump Python dependency versions (#4223)"

This partially reverts commit 7b57512.
  • Loading branch information
bwateratmsft committed Feb 6, 2024
1 parent e6e82c2 commit 907afec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion resources/python/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
if adapterHost.isnumeric():
args[0] = 'host.docker.internal:' + adapterHost

dockerExecArgs = [containerExePath, 'exec', '-d', containerId, 'python', '/debugpy/launcher'] + args
dockerExecArgs = [containerExePath, 'exec', '-d', containerId, 'python3', '/debugpy/launcher'] + args

command = ' '.join(dockerExecArgs)

Expand Down
5 changes: 3 additions & 2 deletions src/debugging/python/PythonDebugHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ export class PythonDebugHelper implements DebugHelper {

// debugLauncherPython controls the interpreter used by the debug adapter to start the launcher, also on the local client
// We want it to use what it would normally use for local Python debugging, i.e. the chosen local interpreter
// This actually launches our launcher in resources/python/launcher.py, which uses `docker exec -d <containerId> python /debugpy/launcher ...` to launch the real debugpy launcher in the container
// This actually launches our launcher in resources/python/launcher.py, which uses `docker exec -d <containerId> python3 /debugpy/launcher ...` to launch the real debugpy launcher in the container
debugLauncherPython: '${command:python.interpreterPath}',
/* eslint-enable no-template-curly-in-string */

// python controls the interpreter used by the launcher to start the application itself
python: 'python',
// Since this is in the container it should always use `python3`
python: 'python3',
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/tasks/python/PythonTaskHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ export class PythonTaskHelper implements TaskHelper {
// User input is honored in all of the below.
runOptions.volumes = this.inferVolumes(runOptions, launcherFolder);

// If the user specifies command, we won't set entrypoint; otherwise if they set entrypoint we will respect it; otherwise use 'python' to start an idle container
runOptions.entrypoint = runOptions.command ? undefined : runOptions.entrypoint || 'python';
// If the user specifies command, we won't set entrypoint; otherwise if they set entrypoint we will respect it; otherwise use 'python3' to start an idle container
runOptions.entrypoint = runOptions.command ? undefined : runOptions.entrypoint || 'python3';

return runOptions;
}
Expand Down

0 comments on commit 907afec

Please sign in to comment.