Skip to content

Commit

Permalink
Fix #1896: Using Ctrl+C causes launcher to print traceback
Browse files Browse the repository at this point in the history
Ignore SIGINT in ptvsd.launcher.
  • Loading branch information
int19h committed Dec 16, 2019
1 parent d2964f2 commit e1476dc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ptvsd/launcher/__main__.py
Expand Up @@ -8,6 +8,7 @@

import locale
import os
import signal
import sys

# WARNING: ptvsd and submodules must not be imported on top level in this module,
Expand All @@ -25,6 +26,11 @@ def main():
log.to_file(prefix="ptvsd.launcher")
log.describe_environment("ptvsd.launcher startup environment:")

# Disable exceptions on Ctrl+C - we want to allow the debuggee process to handle
# these, or not, as it sees fit. If the debuggee exits on Ctrl+C, the launcher
# will also exit, so it doesn't need to observe the signal directly.
signal.signal(signal.SIGINT, signal.SIG_IGN)

def option(name, type, *args):
try:
return type(os.environ.pop(name, *args))
Expand Down

0 comments on commit e1476dc

Please sign in to comment.