diff --git a/IPython/core/page.py b/IPython/core/page.py index 2a0305e..067b540 100644 --- a/IPython/core/page.py +++ b/IPython/core/page.py @@ -100,7 +100,10 @@ def _detect_screen_size(screen_lines_def): # flags each time), we just save the initial terminal state and # unconditionally reset it every time. It's cheaper than making # the checks. - term_flags = termios.tcgetattr(sys.stdout) + try: + term_flags = termios.tcgetattr(sys.stdout) + except termios.error as err: + raise TypeError # Curses modifies the stdout buffer size by default, which messes # up Python's normal stdout buffering. This would manifest itself