From 2b27e2e6a35c3d3e369612b984017fe0d1bfcf0c Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Sun, 12 Mar 2017 12:23:30 -0700 Subject: bpo-29742: asyncio get_extra_info() throws exception (#525) --- Lib/asyncio/sslproto.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Lib/asyncio') diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index 7ad28d6aa0..ab7ff0bf93 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -543,8 +543,10 @@ class SSLProtocol(protocols.Protocol): def _get_extra_info(self, name, default=None): if name in self._extra: return self._extra[name] - else: + elif self._transport is not None: return self._transport.get_extra_info(name, default) + else: + return default def _start_shutdown(self): if self._in_shutdown: -- cgit v1.2.1