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

Make run_sync compatible with python 3.10.9 #902

Closed
wants to merge 2 commits into from
Closed

Conversation

danigm
Copy link

@danigm danigm commented Dec 15, 2022

Make run_sync compatible with python 3.10.9

Fix #901

except RuntimeError:
# In python 3.10.9 this workaround breaks some tests
# test_client.TestKernelClient
# https://docs.python.org/3.10/whatsnew/changelog.html#id3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a more specific link?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, I've used the link to the cpython github issue: python/cpython#83710

except RuntimeError:
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
else:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this changes the behavior. In the else, should we try to use get_running_loop before creating a new event loop?

@blink1073
Copy link
Member

Note that the deprecation warning will be reverted in the next patch release of 3.10 and 3.11. I think we should ignore the warning instead of adding a workaround for a single patch release. cf python/cpython#93453 (comment)

@blink1073
Copy link
Member

I tested against 3.10.10 and verified that it passes now.

@blink1073 blink1073 closed this Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants