Skip to content

Detect Pyodide to avoid get_asyncgen_hooks#795

Merged
almarklein merged 1 commit intomainfrom
pyodide-shortcut
Feb 18, 2026
Merged

Detect Pyodide to avoid get_asyncgen_hooks#795
almarklein merged 1 commit intomainfrom
pyodide-shortcut

Conversation

@almarklein
Copy link
Member

This should avoid the problems with sys.get_asyncgen_hooks() that @Vipitis encountered when trying to port to Pyodide.

@almarklein almarklein requested a review from Korijn as a code owner February 17, 2026 10:54
@Vipitis
Copy link
Contributor

Vipitis commented Feb 17, 2026

I have to try this later. It's rather similar to the change I already made to _async.py in #753 (which is needed even with rendercanvas 2.4, since the logic to return None doesn't seem to work).

I don't expect this will solve the hang, as using rendercanvas 2.5 and calling any async function with pyodides sync_wait causes the hang if I recall correctly. Meaning it's not related to wgpu.

@almarklein
Copy link
Member Author

Meaning it's not related to wgpu.

That makes sense; I am about to apply a similar change in rendercanvas.

@almarklein
Copy link
Member Author

pygfx/rendercanvas#179

@almarklein
Copy link
Member Author

@Vipitis you mentioned that the changes to _async.py in #753 work. However, I prefer the explicit approach in the current PR, otherwise we'd select 'asyncio' also when asyncio does not have a running loop.

@Korijn ready 🚀

@Vipitis
Copy link
Contributor

Vipitis commented Feb 18, 2026

sure, I will merge this variant into the PR branch as soon as I find time

@almarklein almarklein merged commit 3fe71d1 into main Feb 18, 2026
19 checks passed
@almarklein almarklein deleted the pyodide-shortcut branch February 18, 2026 13:55
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.

3 participants