This repository was archived by the owner on Jun 21, 2025. It is now read-only.
forked from sopherapps/pydantic-redis
-
Couldn't load subscription status.
- Fork 4
feat: NestedAsyncIO contextmanager #872
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
89a419b to
1cfe1e4
Compare
|
@all-contributors please add @CharlieJiangXXX for code |
|
I've put up a pull request to add @CharlieJiangXXX! 🎉 |
cielavenir
reviewed
Jun 11, 2025
| (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) |
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.
@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) |
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.
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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