@@ -41,8 +41,8 @@ limitations under the License.
41
41
//
42
42
// This launcher is expected to be invoked as follows:
43
43
//
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 ...
46
46
//
47
47
// This launcher determines the python executable based on
48
48
// `original-command-line`, unwrapping any python scripts, and
@@ -65,22 +65,24 @@ limitations under the License.
65
65
// ```
66
66
// and will then invoke:
67
67
// ```
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
+ //
70
72
// ```
71
73
//
72
74
// The launcher can be configured through several environment
73
75
// variables:
74
76
//
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
84
86
package main
85
87
86
88
import (
@@ -371,8 +373,8 @@ func (pc *pythonContext) updateCommandLine(ctx context.Context) error {
371
373
// debugpy expects the `-m` module argument to be separate
372
374
for i , arg := range pc .args [1 :] {
373
375
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 {
376
378
cmdline = append (cmdline , arg )
377
379
}
378
380
}
@@ -382,9 +384,6 @@ func (pc *pythonContext) updateCommandLine(ctx context.Context) error {
382
384
// Appropriate location to resolve pydevd is set in updateEnv
383
385
cmdline = append (cmdline , pc .args [0 ])
384
386
cmdline = append (cmdline , "-m" , "pydevd" , "--server" , "--port" , strconv .Itoa (int (pc .port )))
385
- if pc .env ["WRAPPER_VERBOSE" ] != "" {
386
- cmdline = append (cmdline , "--DEBUG" )
387
- }
388
387
if ! pc .wait {
389
388
cmdline = append (cmdline , "--continue" )
390
389
}
0 commit comments