-
Notifications
You must be signed in to change notification settings - Fork 181
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
Fix event loop handling #362
Conversation
cc @maartenbreddels this was a nice typing cleanup. :) |
I'll make the release tomorrow. |
Nice indeed :) |
I have some codes that use run_sync(coroutine_a), and with jupyter_core==5.3.2, it stops working. The code complains once I revert to 5.3.1 version. It started to work. Do codes that depend on jupyter_core need to change after this change, any documentation? |
Hi @samuelan, can you please open a new issue with some code that reproduces the error? |
Sure. It's a bit involved. I will try a repro with simplified codes, and circle back when I get it. |
try: | ||
loop = asyncio.get_event_loop() | ||
except RuntimeError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you actually want loop = asyncio.get_running_loop()
here?
According to https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.get_event_loop this is deprecated in python 3.12 and will emit https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.get_event_loop
. This causes some test failures (e.g. in jupyter_client).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I suggested above does fix the test failures in jupyter_client I was getting, at the expense of causing other test failures in jupyter_client.
The only thing that makes the jupyter_client testsuite pass (on python 3.12) is reverting the current PR. I'll downgrade to jupyter_core 5.3.1 for the time being.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes jupyter/jupyter_client#959
Fixes spyder-ide/spyder#21338