Fix a traceback when the terminal is not behaving as it should

This commit is contained in:
mathieui 2014-10-14 16:16:11 +02:00
parent 545ad1bd71
commit 076b899b45
No known key found for this signature in database
GPG key ID: C59F84CEEFD616E3

View file

@ -115,6 +115,8 @@ class Keyboard(object):
# Disable the timeout
s.timeout(-1)
ret_list = get_char_list(s)
if not ret_list:
return ret_list
if len(ret_list) != 1:
if ret_list[-1] == '^M':
ret_list.pop(-1)