Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 16, 2024
1 parent 38045cc commit 2692565
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/signalkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ async def do_execute(
reply["user_expressions"]["env"] = os.getenv("TEST_VARS", "")
elif code == "sleep":
import ipykernel

if ipykernel.version_info < (7, 0):
# ipykernel before anyio.
try:
Expand All @@ -57,8 +58,8 @@ async def do_execute(
else:
reply["user_expressions"]["interrupted"] = False
else:
# ipykernel after anyio.
from anyio import open_signal_receiver, create_task_group, sleep
# ipykernel after anyio.
from anyio import create_task_group, open_signal_receiver, sleep

async def signal_handler(cancel_scope, reply):
with open_signal_receiver(signal.SIGINT) as signals:
Expand Down

0 comments on commit 2692565

Please sign in to comment.