From b6f82ca020cf18c7cfe7e73904d58daefdd1183d Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 14 Jan 2016 11:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dvim=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E5=A4=A7=E5=B0=8F=E4=B8=AD=E6=96=ADbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- connect.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/connect.py b/connect.py index 79b266e29..92b2f74cc 100755 --- a/connect.py +++ b/connect.py @@ -415,7 +415,10 @@ class SshTty(Tty): pass if sys.stdin in r: - x = os.read(sys.stdin.fileno(), 4096) + try: + x = os.read(sys.stdin.fileno(), 4096) + except OSError: + pass input_mode = True if str(x) in ['\r', '\n', '\r\n']: if self.vim_flag: @@ -803,7 +806,7 @@ def main(): color_print('请输入正确ID', 'red') except ServerError, e: color_print(e, 'red') - except Exception, e: + except IndexError, e: color_print(e) time.sleep(5) pass