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 #179
  • Loading branch information
jackthepirate6 committed Feb 3, 2018
1 parent 6adab90 commit aa6d399
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
@@ -1,6 +1,7 @@
import argparse
import logging
import os
import signal
import sys

from pyprint.ConsolePrinter import ConsolePrinter
Expand Down Expand Up @@ -57,13 +58,18 @@ def _get_arg_parser():
return arg_parser


def signal_handler(self, cls):
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 aa6d399

Please sign in to comment.