@@ -41,8 +41,8 @@ limitations under the License.
4141//
4242// This launcher is expected to be invoked as follows:
4343//
44- // launcher --mode <pydevd|pydevd-pycharm|debugpy|ptvsd> \
45- // --port p [--wait] -- original-command-line ...
44+ // launcher --mode <pydevd|pydevd-pycharm|debugpy|ptvsd> \
45+ // --port p [--wait] -- original-command-line ...
4646//
4747// This launcher determines the python executable based on
4848// `original-command-line`, unwrapping any python scripts, and
@@ -65,22 +65,24 @@ limitations under the License.
6565// ```
6666// and will then invoke:
6767// ```
68- // python -m pydevd --server --port 5678 --DEBUG --continue \
69- // --file /tmp/pydevd716531212/skaffold_pydevd_launch.py
68+ //
69+ // python -m pydevd --server --port 5678 --continue \
70+ // --file /tmp/pydevd716531212/skaffold_pydevd_launch.py
71+ //
7072// ```
7173//
7274// The launcher can be configured through several environment
7375// variables:
7476//
75- // - Set `WRAPPER_ENABLED=false` to disable the launcher: the
76- // launcher will execute the original-command-line as-is.
77- // - Set `WRAPPER_SKIP_ENV=true` to avoid setting PYTHONPATH
78- // to point to bundled debugging backends: this is useful if
79- // your app already includes `debugpy`.
80- // - Set `WRAPPER_PYTHON_VERSION=3.9` to avoid trying to determine
81- // the python version by executing `python -V`
82- // - Set `WRAPPER_VERBOSE` to one of `error`, `warn`, `info`, `debug`,
83- // or `trace` to reduce or increase the verbosity
77+ // - Set `WRAPPER_ENABLED=false` to disable the launcher: the
78+ // launcher will execute the original-command-line as-is.
79+ // - Set `WRAPPER_SKIP_ENV=true` to avoid setting PYTHONPATH
80+ // to point to bundled debugging backends: this is useful if
81+ // your app already includes `debugpy`.
82+ // - Set `WRAPPER_PYTHON_VERSION=3.9` to avoid trying to determine
83+ // the python version by executing `python -V`
84+ // - Set `WRAPPER_VERBOSE` to one of `error`, `warn`, `info`, `debug`,
85+ // or `trace` to reduce or increase the verbosity
8486package main
8587
8688import (
@@ -371,8 +373,8 @@ func (pc *pythonContext) updateCommandLine(ctx context.Context) error {
371373 // debugpy expects the `-m` module argument to be separate
372374 for i , arg := range pc .args [1 :] {
373375 if i == 0 && arg != "-m" && strings .HasPrefix (arg , "-m" ) {
374- cmdline = append (cmdline , "-m" , strings .TrimPrefix (arg , "-m" ))
375- } else {
376+ cmdline = append (cmdline , "-m" , strings .TrimPrefix (arg , "-m" ))
377+ } else {
376378 cmdline = append (cmdline , arg )
377379 }
378380 }
@@ -382,9 +384,6 @@ func (pc *pythonContext) updateCommandLine(ctx context.Context) error {
382384 // Appropriate location to resolve pydevd is set in updateEnv
383385 cmdline = append (cmdline , pc .args [0 ])
384386 cmdline = append (cmdline , "-m" , "pydevd" , "--server" , "--port" , strconv .Itoa (int (pc .port )))
385- if pc .env ["WRAPPER_VERBOSE" ] != "" {
386- cmdline = append (cmdline , "--DEBUG" )
387- }
388387 if ! pc .wait {
389388 cmdline = append (cmdline , "--continue" )
390389 }
0 commit comments