Skip to content

Commit

Permalink
Fix a crash in pypy.
Browse files Browse the repository at this point in the history
Apparently, in pypy, "signal.set_wakeup_fd" doesn't have the keyword argument warn_on_full_buffer.

Here is a simple script to reproduce this problem:
import trio

async def handler(stream: trio.abc.Stream):
    await stream.receive_some(1)

async def trio_main():
    socket_listeners = await trio.serve_tcp(handler)

trio.run(trio_main)
  • Loading branch information
leojay authored Oct 19, 2020
1 parent e0f6b0d commit 9da6267
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trio/_core/_wakeup_socketpair.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .. import _core
from .._util import is_main_thread

if sys.version_info >= (3, 7):
if sys.version_info >= (3, 7) and '__pypy__' not in sys.builtin_module_names:
HAVE_WARN_ON_FULL_BUFFER = True
else:
HAVE_WARN_ON_FULL_BUFFER = False
Expand Down

0 comments on commit 9da6267

Please sign in to comment.