From f95a8ef28bb05dfb1f7fc94ddbfc0934359bf0c4 2016-08-21 21:30:13 From: pietvo Date: 2016-08-21 21:30:13 Subject: [PATCH] Update prompts.py Get rid of spurious newline after the output prompt (Out[n]: ) in cases where prompt_toolkit is not used (e.g. running ipython inside Emacs) --- diff --git a/IPython/terminal/prompts.py b/IPython/terminal/prompts.py index 732a711..f52862b 100644 --- a/IPython/terminal/prompts.py +++ b/IPython/terminal/prompts.py @@ -71,4 +71,4 @@ class RichPromptDisplayHook(DisplayHook): if self.shell.pt_cli: self.shell.pt_cli.print_tokens(tokens) else: - print(*(s for t, s in tokens), sep='') + sys.stdout.write(''.join(s for t, s in tokens))