Skip to content

Commit 63784e0

Browse files
author
Christopher Doris
committed
don't override Base.stdout
1 parent bd775f9 commit 63784e0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/compat/ipython.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ function init_ipython()
4242
if C.CTX.is_embedded && CONFIG.auto_ipython_display
4343
is_ipython = ("IPython" in pysysmodule.modules) && !pyisnone(pysysmodule.modules["IPython"].get_ipython())
4444
if is_ipython
45-
# Set `Base.stdout` to `sys.stdout` and ensure it is flushed after each execution
46-
@eval Base stdout = $(PyIO(pysysmodule.stdout))
47-
pysysmodule.modules["IPython"].get_ipython().events.register("post_execute", pycallback(() -> (flush(Base.stdout); nothing)))
45+
# We used to set `Base.stdout` to `sys.stdout` and ensure it is flushed after each execution.
46+
# But `Base.stdout` is expected to be a "real" file in some places (e.g. when spawning tasks).
4847
# set displays so that Base.display() renders in ipython
49-
pushdisplay(TextDisplay(Base.stdout))
48+
# pushdisplay(TextDisplay(Base.stdout))
5049
pushdisplay(IPythonDisplay())
5150
end
5251
end

0 commit comments

Comments
 (0)