Skip to content

Commit dcdc56e

Browse files
Fix OutStream using _fid before being defined (#1373)
1 parent dab3b39 commit dcdc56e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ipykernel/iostream.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,9 @@ def _watch_pipe_fd(self):
388388
389389
"""
390390

391+
if self._fid is None:
392+
return
393+
391394
try:
392395
bts = os.read(self._fid, PIPE_BUFFER_SIZE)
393396
while bts and self._should_watch:
@@ -441,6 +444,7 @@ def __init__(
441444
self.session = session
442445
self._has_thread = False
443446
self.watch_fd_thread = None
447+
self._fid = None
444448
if not isinstance(pub_thread, IOPubThread):
445449
# Backward-compat: given socket, not thread. Wrap in a thread.
446450
warnings.warn(

0 commit comments

Comments
 (0)