From 71421bfb97f630c239a66858abbec0436db8f5c6 Mon Sep 17 00:00:00 2001 From: Ray Burgemeestre Date: Tue, 24 Jan 2017 17:32:35 +0100 Subject: [PATCH] Always install default signal handler for SIGINT. This way the Python process running DIGITS can always be stopped with SIGINT. (Python doesn't install this default handler in all cases.) --- digits/__main__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/digits/__main__.py b/digits/__main__.py index 0bbfac5bf..82f73c908 100644 --- a/digits/__main__.py +++ b/digits/__main__.py @@ -3,6 +3,7 @@ import argparse import os.path import sys +import signal # Update PATH to include the local DIGITS directory @@ -15,6 +16,8 @@ if not found_parent_dir: sys.path.insert(0, PARENT_DIR) +# Install default signal handler for SIGINT +signal.signal(signal.SIGINT, signal.default_int_handler) def main(): parser = argparse.ArgumentParser(description='DIGITS server')