Skip to content

Commit

Permalink
Make Iterator a daemon for proper exit
Browse files Browse the repository at this point in the history
Conflicts:
	pyfirmata/util.py
  • Loading branch information
jochasinga committed Aug 5, 2015
1 parent 0cdfcb6 commit fb11044
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyfirmata/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import unicode_literals
import threading
import time
import os
import os, sys

import serial

Expand Down Expand Up @@ -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:
Expand All @@ -63,6 +64,8 @@ def run(self):
pass
raise

except (KeyboardInterrupt) as e:
sys.exit()

def to_two_bytes(integer):
"""
Expand Down

0 comments on commit fb11044

Please sign in to comment.