diff options
author | Yury Selivanov <yury@magic.io> | 2017-12-18 17:03:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-18 17:03:23 -0500 |
commit | d757aaf9dd767d13205bf9917e520ebf43e7f6e5 (patch) | |
tree | 2e0c92b2daf71cdf63c68a392e49aaa0a730daf7 /Lib/asyncio/sslproto.py | |
parent | 2d8f06382e7d5a759ca554110a699a397114824a (diff) | |
download | cpython-git-d757aaf9dd767d13205bf9917e520ebf43e7f6e5.tar.gz |
bpo-32356: idempotent pause_/resume_reading; new is_reading method. (#4914)
Diffstat (limited to 'Lib/asyncio/sslproto.py')
-rw-r--r-- | Lib/asyncio/sslproto.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index 0c8f01ad8f..8da8570d66 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -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. |