idf_monitor: Fixed a bug where pressing a key that doesn't encode into

a proper ASCII character, terminated the monitor with an exception
pull/1217/merge
Krzysztof Bociurko 2017-10-20 11:55:18 +02:00 zatwierdzone przez Ivan Grokhotkov
rodzic 8712fd3ccf
commit 5827fd8c71
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -292,6 +292,8 @@ class Monitor(object):
self.serial.write(codecs.encode(key))
except serial.SerialException:
pass # this shouldn't happen, but sometimes port has closed in serial thread
except UnicodeEncodeError:
pass # this can happen if a non-ascii character was passed, ignoring
def handle_serial_input(self, data):
# this may need to be made more efficient, as it pushes out a byte