Fix #92: Debugging as sudo fails to terminate the debugger when you stop

Apply sudo to debugpy.launcher, rather than the debuggee itself.
This commit is contained in:
Pavel Minaev 2020-04-01 19:17:13 -07:00 committed by Pavel Minaev
parent 2d35573eda
commit 32c00bc85c
5 changed files with 47 additions and 19 deletions

View file

@ -492,8 +492,7 @@ class Session(object):
env = request("env", json.object(unicode))
try:
exe = args.pop(0)
assert not len(self.spawn_debuggee.env)
self.spawn_debuggee.env = env
self.spawn_debuggee.env.update(env)
self.spawn_debuggee(args, cwd, exe=exe)
return {}
except OSError as exc: