diff --git a/pyfirmata/util.py b/pyfirmata/util.py index 85eba9f0..43675fa5 100644 --- a/pyfirmata/util.py +++ b/pyfirmata/util.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import threading import time -import os +import os, sys import serial @@ -39,6 +39,7 @@ class Iterator(threading.Thread): def __init__(self, board): super(Iterator, self).__init__() self.board = board + self.daemon = True def run(self): while 1: @@ -63,6 +64,8 @@ def run(self): pass raise + except (KeyboardInterrupt) as e: + sys.exit() def to_two_bytes(integer): """