Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use supported event loop behavior #382

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
fix typing
blink1073 committed Dec 26, 2023
commit 9237a5b126657b0c8b93a91025e9e6820691f572
4 changes: 2 additions & 2 deletions jupyter_core/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -191,7 +191,7 @@ def get_event_loop(prefer_selector_loop: bool = False) -> asyncio.AbstractEventL
# Get the loop for this thread, or create a new one.
loop = _thread_data.loop
if loop and not loop.is_closed():
return loop
return loop # type:ignore[no-any-return]
try:
loop = asyncio.get_running_loop()
except RuntimeError:
@@ -201,4 +201,4 @@ def get_event_loop(prefer_selector_loop: bool = False) -> asyncio.AbstractEventL
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
_thread_data.loop = loop
return loop
return loop # type:ignore[no-any-return]