bpo-32356: idempotent pause_/resume_reading; new is_reading method. (#4914)

This commit is contained in:
Yury Selivanov 2017-12-18 17:03:23 -05:00 committed by GitHub
parent 2d8f06382e
commit d757aaf9dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 87 additions and 24 deletions

View file

@ -317,6 +317,12 @@ class _SSLProtocolTransport(transports._FlowControlMixin,
source=self)
self.close()
def is_reading(self):
tr = self._ssl_protocol._transport
if tr is None:
raise RuntimeError('SSL transport has not been initialized yet')
return tr.is_reading()
def pause_reading(self):
"""Pause the receiving end.