diff options
| author | kjav <sam.rr.lee@gmail.com> | 2015-09-02 11:51:26 +0100 |
|---|---|---|
| committer | kjav <sam.rr.lee@gmail.com> | 2015-09-02 11:51:26 +0100 |
| commit | 0b66fa1754b20e9e8cd9385337440f76f49e1aaf (patch) | |
| tree | 223f92f5a1bef78d6270e4e03d557f1ea9970734 /OpenSSL/SSL.py | |
| parent | 09b739514008ef7728e387ffd4c9446cadfbd1c5 (diff) | |
| download | pyopenssl-0b66fa1754b20e9e8cd9385337440f76f49e1aaf.tar.gz | |
getattr now works when no socket is wrapped
Diffstat (limited to 'OpenSSL/SSL.py')
| -rw-r--r-- | OpenSSL/SSL.py | 5 |
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): |
