From 3ac905fda7a04273804d16068aae29622ed3ef4c 2017-11-17 08:58:54 From: Thomas Kluyver Date: 2017-11-17 08:58:54 Subject: [PATCH] Backport PR #10907: BUG sphinxext: ensure sys.stdout is used for logging (#10904) --- diff --git a/IPython/sphinxext/ipython_directive.py b/IPython/sphinxext/ipython_directive.py index e863fb6..8df9ace 100644 --- a/IPython/sphinxext/ipython_directive.py +++ b/IPython/sphinxext/ipython_directive.py @@ -295,14 +295,6 @@ class EmbeddedSphinxShell(object): IP = InteractiveShell.instance(config=config, profile_dir=profile) atexit.register(self.cleanup) - sys.stdout = self.cout - sys.stderr = self.cout - - # For debugging, so we can see normal output, use this: - #from IPython.utils.io import Tee - #sys.stdout = Tee(self.cout, channel='stdout') # dbg - #sys.stderr = Tee(self.cout, channel='stderr') # dbg - # Store a few parts of IPython we'll need. self.IP = IP self.user_ns = self.IP.user_ns