summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ssl.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-04-23 22:54:59 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-04-23 22:54:59 (GMT)
commitdfb299bb95040d5e96690afd93f7212e81b70722 (patch)
tree571b7ade596761f9cd9278aa09d8dc3963a4bc5d /Lib/test/test_ssl.py
parent1273566cb75e188af7cc38c08df21ba9e07260f4 (diff)
downloadcpython-dfb299bb95040d5e96690afd93f7212e81b70722.zip
cpython-dfb299bb95040d5e96690afd93f7212e81b70722.tar.gz
cpython-dfb299bb95040d5e96690afd93f7212e81b70722.tar.bz2
Issue #7943: Fix circular reference created when instantiating an SSL
socket. Initial patch by Péter Szabó.
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r--Lib/test/test_ssl.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 458db26..5917b51 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -11,6 +11,7 @@ import os
import pprint
import urllib, urlparse
import traceback
+import weakref
from BaseHTTPServer import HTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
@@ -154,6 +155,16 @@ class BasicTests(unittest.TestCase):
with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be selected"):
s.connect(remote)
+ @test_support.cpython_only
+ def test_refcycle(self):
+ # Issue #7943: an SSL object doesn't create reference cycles with
+ # itself.
+ s = socket.socket(socket.AF_INET)
+ ss = ssl.wrap_socket(s)
+ wr = weakref.ref(ss)
+ del ss
+ self.assertEqual(wr(), None)
+
class NetworkedTests(unittest.TestCase):