Skip to content

Commit b739653

Browse files
Add *Channel.is_closed().
1 parent ef85d34 commit b739653

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Lib/test/support/interpreters.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ def id(self):
165165
def _info(self):
166166
return _channels.get_info(self._id)
167167

168+
@property
169+
def is_closed(self):
170+
return self._info.closed
171+
168172

169173
_NOT_SET = object()
170174

@@ -217,6 +221,11 @@ class SendChannel(_ChannelEnd):
217221

218222
_end = 'send'
219223

224+
@property
225+
def is_closed(self):
226+
info = self._info
227+
return info.closed or info.closing
228+
220229
def send(self, obj, timeout=None):
221230
"""Send the object (i.e. its data) to the channel's receiving end.
222231

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy