Skip to content

Commit

Permalink
Exit peacefully on KeyboardInterrupt
Browse files Browse the repository at this point in the history
Captured keyboardinterrupt without traceback.

Closes issue #179
  • Loading branch information
jackthepirate6 committed Feb 2, 2018
1 parent 6adab90 commit 9e7d628
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions coala_quickstart/coala_quickstart.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging
import os
import sys
import signal

from pyprint.ConsolePrinter import ConsolePrinter

Expand Down Expand Up @@ -57,13 +58,18 @@ def _get_arg_parser():
return arg_parser


def signal_handler(signal, frame):
sys.exit(0)


def main():
arg_parser = _get_arg_parser()
args = arg_parser.parse_args()

logging.basicConfig(stream=sys.stdout)
printer = ConsolePrinter()
logging.getLogger(__name__)
signal.signal(signal.SIGINT, signal_handler)

fpc = None
project_dir = os.getcwd()
Expand Down

0 comments on commit 9e7d628

Please sign in to comment.