Skip to content

Commit 51ae59f

Browse files
committed
detach io thread output from creation cell
1 parent d7713f6 commit 51ae59f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: ipyparallel/client/client.py

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import re
99
import socket
10+
import sys
1011
import time
1112
import types
1213
import warnings
@@ -1078,6 +1079,13 @@ def _io_main(self, start_evt=None):
10781079
"""main loop for background IO thread"""
10791080
self._io_loop = self._make_io_loop()
10801081
self._setup_streams()
1082+
1083+
# disable ipykernel's association of thread output with the cell that
1084+
# spawned the thread.
1085+
# there should be a public API for this...
1086+
for stream in [sys.stdout, sys.stderr]:
1087+
if getattr(stream, "_thread_to_parent", None):
1088+
stream._thread_to_parent.pop(current_thread().ident, None)
10811089
# signal that start has finished
10821090
# so that the main thread knows that all our attributes are defined
10831091
if start_evt:

0 commit comments

Comments
 (0)