From 93cc2461282067a3601d6ac546a99a40a60eef93 Mon Sep 17 00:00:00 2001 From: Eric Lin Date: Tue, 17 Apr 2018 23:50:57 -0400 Subject: Added check for whether the terminal is present before reprinting the prompt. Re-enabled test cases that were failing due to there not being a terminal during unit tests. --- rl_utils.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'rl_utils.py') diff --git a/rl_utils.py b/rl_utils.py index 11c45ee4..1dc83d15 100644 --- a/rl_utils.py +++ b/rl_utils.py @@ -47,6 +47,8 @@ def rl_force_redisplay() -> None: """ Causes readline to redraw prompt and input line """ + if not sys.stdout.isatty(): + return if rl_type == RlType.GNU: # rl_forced_update_display() is the proper way to redraw the prompt and line, but we # have to use ctypes to do it since Python's readline API does not wrap the function -- cgit v1.2.1