Skip to content

Commit 903b031

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 10612cd commit 903b031

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

ipykernel/eventloops.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -452,16 +452,18 @@ def process_stream_events(shell_stream):
452452
shell_stream = get_shell_stream(kernel)
453453
notifier = partial(process_stream_events, shell_stream)
454454

455-
if os.name=='nt':
456-
stop_event=asyncio.Event()
455+
if os.name == "nt":
456+
stop_event = asyncio.Event()
457+
457458
def blocking_poll():
458-
poller=zmq.Poller()
459+
poller = zmq.Poller()
459460
poller.register(shell_stream.socket, zmq.POLLIN)
460461

461462
while stop_event.is_set():
462-
events=poller.poll(None)
463+
events = poller.poll(None)
463464
if events:
464465
loop.calls_soon_threadsafe(notifier)
466+
465467
t = threading.Thread(target=blocking_poll, daemon=True).start()
466468
else:
467469
loop.add_reader(shell_stream.getsockopt(zmq.FD), notifier)
@@ -476,7 +478,7 @@ def blocking_poll():
476478
except Exception as e:
477479
error = e
478480
if loop._should_close: # type:ignore[attr-defined]
479-
if os.name=='nt':
481+
if os.name == "nt":
480482
stop_event.set()
481483
t.join()
482484
loop.close()

0 commit comments

Comments
 (0)