Skip to content
This repository was archived by the owner on Jun 21, 2025. It is now read-only.

feat: NestedAsyncIO contextmanager #872

Merged
merged 4 commits into from
May 8, 2024

Conversation

andrewthetechie
Copy link
Owner

This comes from erdewit/nest_asyncio#88 implemented by @CharlieJiangXXX before NestedAsyncIO was archived.

It should help with some issues where the patched eventloop causes problems with some other libraries, like Discord.py, that do some "odd" things with eventloops

This comes from erdewit/nest_asyncio#88
implemented by @CharlieJiangXXX before NestedAsyncIO was archived.

It should help with some issues where the patched eventloop causes
problems with some other libraries, like Discord.py, that do some "odd"
things with eventloops
@andrewthetechie andrewthetechie force-pushed the nested-asyncio-contextmanager branch from 89a419b to 1cfe1e4 Compare May 8, 2024 00:13
Repository owner deleted a comment from allcontributors bot May 8, 2024
@andrewthetechie
Copy link
Owner Author

@all-contributors please add @CharlieJiangXXX for code

Copy link

@andrewthetechie

I've put up a pull request to add @CharlieJiangXXX! 🎉

@andrewthetechie andrewthetechie merged commit f061046 into main May 8, 2024
@andrewthetechie andrewthetechie deleted the nested-asyncio-contextmanager branch May 8, 2024 00:23
(asyncio.Future, asyncio.futures._CFuture, asyncio.futures.Future) = self.orig_futures
if sys.version_info >= (3, 9, 0):
for key, value in self.orig_get_loops.items():
setattr(asyncio if key.startswith("asyncio") else events, key.split("_")[-1], value)

Choose a reason for hiding this comment

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

@andrewthetechie @CharlieJiangXXX just in case, should this be key.split("_", 1)?

Suggested change
setattr(asyncio if key.startswith("asyncio") else events, key.split("_")[-1], value)
setattr(asyncio if key.startswith("asyncio") else events, key.split("_", 1)[-1], value)

Choose a reason for hiding this comment

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

It is unfortunate that I cannot put comment to erdewit/nest_asyncio#88 anymore

cielavenir added a commit to cielavenir/nest_asyncio that referenced this pull request Jun 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants