8000 gh-76785: Module-level Fixes for test.support.interpreters by ericsnowcurrently · Pull Request #110236 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-76785: Module-level Fixes for test.support.interpreters #110236

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

Merged
merged 9 commits into from
Oct 2, 2023
Next Next commit
Add RecvChannel.close() and SendChannel.close().
  • Loading branch information
ericsnowcurrently committed Sep 29, 2023
commit e958fbc8cb638b9b405b87446222fa837575b779
6 changes: 6 additions & 0 deletions Lib/test/support/interpreters.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ def recv_nowait(self, default=_NOT_SET):
else:
return _channels.recv(self._id, default)

def close(self):
_channels.close(self._id, recv=True)


class SendChannel(_ChannelEnd):
"""The sending end of a cross-interpreter channel."""
Expand All @@ -196,3 +199,6 @@ def send_nowait(self, obj):
# None. This should be fixed when channel_send_wait() is added.
# See bpo-32604 and gh-19829.
return _channels.send(self._id, obj)

def close(self):
_channels.close(self._id, send=True)
0