File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -431,7 +431,6 @@ def loop_cocoa_exit(kernel):
431431def loop_asyncio (kernel ):
432432 """Start a kernel with asyncio event loop support."""
433433 import asyncio
434- import threading
435434
436435 loop = asyncio .get_event_loop ()
437436 # loop is already running (e.g. tornado 5), nothing left to do
@@ -452,25 +451,8 @@ def process_stream_events(shell_stream):
452451
453452 shell_stream = get_shell_stream (kernel )
454453 notifier = partial (process_stream_events , shell_stream )
455-
456- if os .name == "nt" :
457- stop_event = asyncio .Event ()
458- t = None
459-
460- def blocking_poll ():
461- poller = zmq .Poller ()
462- poller .register (shell_stream .socket , zmq .POLLIN )
463-
464- while not stop_event .is_set ():
465- events = poller .poll (None )
466- if events :
467- loop .call_soon_threadsafe (notifier )
468-
469- t = threading .Thread (target = blocking_poll , daemon = True )
470- t .start ()
471- else :
472- loop .add_reader (shell_stream .getsockopt (zmq .FD ), notifier )
473- loop .call_soon (notifier )
454+ loop .add_reader (shell_stream .getsockopt (zmq .FD ), notifier )
455+ loop .call_soon (notifier )
474456
475457 while True :
476458 error = None
@@ -481,10 +463,6 @@ def blocking_poll():
481463 except Exception as e :
482464 error = e
483465 if loop ._should_close : # type:ignore[attr-defined]
484- if os .name == "nt" :
485- stop_event .set ()
486- if t is not None :
487- t .join ()
488466 loop .close ()
489467 if error is not None :
490468 raise error
You can’t perform that action at this time.
0 commit comments