diff options
author | Bill Janssen <janssen@parc.com> | 2008-08-12 16:31:21 (GMT) |
---|---|---|
committer | Bill Janssen <janssen@parc.com> | 2008-08-12 16:31:21 (GMT) |
commit | 39295c2650fe3f7d0a94bfa172e95cfedb28433f (patch) | |
tree | e2f1df451c0c263172a82a2a0dee27caec7f3ae7 /Lib/ssl.py | |
parent | f91d46a17d85da323895950852093117bc21f860 (diff) | |
download | cpython-39295c2650fe3f7d0a94bfa172e95cfedb28433f.zip cpython-39295c2650fe3f7d0a94bfa172e95cfedb28433f.tar.gz cpython-39295c2650fe3f7d0a94bfa172e95cfedb28433f.tar.bz2 |
remove duplicate close() from ssl.py; expose unwrap and add test for it
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r-- | Lib/ssl.py | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -234,15 +234,19 @@ class SSLSocket (socket): else: return 0 + def unwrap (self): + if self._sslobj: + s = self._sslobj.shutdown() + self._sslobj = None + return s + else: + raise ValueError("No SSL wrapper around " + str(self)) + def shutdown (self, how): self._sslobj = None socket.shutdown(self, how) def close (self): - self._sslobj = None - socket.close(self) - - def close (self): if self._makefile_refs < 1: self._sslobj = None socket.close(self) |