From d757aaf9dd767d13205bf9917e520ebf43e7f6e5 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Mon, 18 Dec 2017 17:03:23 -0500 Subject: bpo-32356: idempotent pause_/resume_reading; new is_reading method. (#4914) --- Lib/asyncio/sslproto.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Lib/asyncio/sslproto.py') 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. -- cgit v1.2.1