Skip to content

Commit 1caa453

Browse files
Add *Channel.is_closed().
1 parent 6109470 commit 1caa453

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)