From 076b899b459925f9e5b9ee68adc507183f2cbe2f Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 14 Oct 2014 16:16:11 +0200 Subject: Fix a traceback when the terminal is not behaving as it should --- src/keyboard.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/keyboard.py b/src/keyboard.py index 3a8f3537..ec1e7d0a 100755 --- a/src/keyboard.py +++ b/src/keyboard.py @@ -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) -- cgit v1.2.3