summaryrefslogtreecommitdiffstats
path: root/Lib/ssl.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-08-08 23:24:50 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-08-08 23:24:50 (GMT)
commite43f9d0ed69addbc34bac4af1b3ad7f1bdd3b149 (patch)
treee15aa8c051472ddb7ec9a684d9a4e546ee3e14ca /Lib/ssl.py
parentba8a98600eddc5e2a87a9148e634ada1a1056495 (diff)
downloadcpython-e43f9d0ed69addbc34bac4af1b3ad7f1bdd3b149.zip
cpython-e43f9d0ed69addbc34bac4af1b3ad7f1bdd3b149.tar.gz
cpython-e43f9d0ed69addbc34bac4af1b3ad7f1bdd3b149.tar.bz2
Issue #8524: Add a forget() method to socket objects, so as to put the
socket into the closed state without closing the underlying file descriptor.
Diffstat (limited to 'Lib/ssl.py')
-rw-r--r--Lib/ssl.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/ssl.py b/Lib/ssl.py
index 585105d..7bcc67e 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -79,7 +79,6 @@ from _ssl import (
from socket import getnameinfo as _getnameinfo
from socket import error as socket_error
-from socket import dup as _dup
from socket import socket, AF_INET, SOCK_STREAM
import base64 # for DER-to-PEM translation
import traceback
@@ -148,7 +147,7 @@ class SSLSocket(socket):
family=sock.family,
type=sock.type,
proto=sock.proto,
- fileno=_dup(sock.fileno()))
+ fileno=sock.fileno())
self.settimeout(sock.gettimeout())
# see if it's connected
try:
@@ -158,7 +157,7 @@ class SSLSocket(socket):
raise
else:
connected = True
- sock.close()
+ sock.forget()
elif fileno is not None:
socket.__init__(self, fileno=fileno)
else: