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

a proper ASCII character, terminated the monitor with an exception
This commit is contained in:
Krzysztof Bociurko
2017-10-20 11:55:18 +02:00
committed by Ivan Grokhotkov
parent 8712fd3ccf
commit 5827fd8c71

View File

@@ -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