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

Improve error message for eventlet/gevent monkey patching #3140

Merged
merged 4 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions newsfragments/3087.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve error message when run after gevent's monkey patching.
7 changes: 6 additions & 1 deletion src/trio/_core/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2953,7 +2953,12 @@ async def checkpoint_if_cancelled() -> None:
_KqueueStatistics as IOStatistics,
)
else: # pragma: no cover
raise NotImplementedError("unsupported platform")
if "eventlet" in sys.modules or "gevent" in sys.modules:
raise NotImplementedError(
"unsupported platform or primitives trio depends on are monkey-patched out",
)
else:
raise NotImplementedError("unsupported platform")
A5rocks marked this conversation as resolved.
Show resolved Hide resolved

from ._generated_instrumentation import *
from ._generated_run import *
Loading