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 greenlets rather than threads for sync loop #137

Merged
merged 6 commits into from
Feb 1, 2024

Conversation

oremanj
Copy link
Member

@oremanj oremanj commented Jan 30, 2024

Fixes #132.

@jakkdl
Copy link
Member

jakkdl commented Jan 30, 2024

Could perhaps add a regression test that spins up an ipython prompt and attempts to import trio_asyncio?

@oremanj
Copy link
Member Author

oremanj commented Jan 30, 2024

I tested that manually; it doesn't seem worth adding a test dependency on IPython just for this. The previous error was because the event loop is a per-thread construct and we were trying to run it in a different thread; honestly I'm surprised it appeared to work as far as it did.

Copy link
Member

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

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

This looks good to me, though there might well be a subtle problem that I missed 😅

@oremanj oremanj merged commit 2557e94 into python-trio:master Feb 1, 2024
25 checks passed
@oremanj oremanj deleted the sync-with-greenlet branch February 1, 2024 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Importing trio-asyncio from within IPython crashes IPython
3 participants