diff options
Diffstat (limited to 'src/keyboard.py')
-rw-r--r-- | src/keyboard.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/keyboard.py b/src/keyboard.py index 5f7411c1..265fa00b 100644 --- a/src/keyboard.py +++ b/src/keyboard.py @@ -61,7 +61,10 @@ def read_char(s): if 240 <= first: (code, c) = get_next_byte(s) # 4 bytes char char += c - return char.decode('utf-8')# return all the concatened byte objets, decoded + try: + return char.decode('utf-8') # return all the concatened byte objets, decoded + except UnicodeDecodeError: + return None if __name__ == '__main__': import curses |