summaryrefslogtreecommitdiff
path: root/OpenSSL/SSL.py
diff options
context:
space:
mode:
authorkjav <sam.rr.lee@gmail.com>2015-09-02 11:51:26 +0100
committerkjav <sam.rr.lee@gmail.com>2015-09-02 11:51:26 +0100
commit0b66fa1754b20e9e8cd9385337440f76f49e1aaf (patch)
tree223f92f5a1bef78d6270e4e03d557f1ea9970734 /OpenSSL/SSL.py
parent09b739514008ef7728e387ffd4c9446cadfbd1c5 (diff)
downloadpyopenssl-0b66fa1754b20e9e8cd9385337440f76f49e1aaf.tar.gz
getattr now works when no socket is wrapped
Diffstat (limited to 'OpenSSL/SSL.py')
-rw-r--r--OpenSSL/SSL.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/OpenSSL/SSL.py b/OpenSSL/SSL.py
index 2317404..6b0b944 100644
--- a/OpenSSL/SSL.py
+++ b/OpenSSL/SSL.py
@@ -1146,7 +1146,10 @@ class Connection(object):
Look up attributes on the wrapped socket object if they are not found on
the Connection object.
"""
- return getattr(self._socket, name)
+ if self._socket is None:
+ raise AttributeError("'" + self.__class__.__name__ + "' object has no attribute '" + name + "'")
+ else:
+ return getattr(self._socket, name)
def _raise_ssl_error(self, ssl, result):