summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ssl.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-04-23 23:12:22 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-04-23 23:12:22 (GMT)
commit78f4a9a1f561553bfb02f32fb3d25541edb37c5b (patch)
tree368a2178240c5f2847683dafa447e85cba0472a0 /Lib/test/test_ssl.py
parent5d44b7d2b3bc3ff59ef893f93796e83f7a5e19fd (diff)
downloadcpython-78f4a9a1f561553bfb02f32fb3d25541edb37c5b.zip
cpython-78f4a9a1f561553bfb02f32fb3d25541edb37c5b.tar.gz
cpython-78f4a9a1f561553bfb02f32fb3d25541edb37c5b.tar.bz2
Merged revisions 80426 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r80426 | antoine.pitrou | 2010-04-24 01:10:32 +0200 (sam., 24 avril 2010) | 13 lines Only the test is merged in. Merged revisions 80423 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80423 | antoine.pitrou | 2010-04-24 00:54:59 +0200 (sam., 24 avril 2010) | 4 lines 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 fb9c9a2..eab15ab 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -14,6 +14,7 @@ import urllib.parse, urllib.request
import shutil
import traceback
import asyncore
+import weakref
from http.server import HTTPServer, SimpleHTTPRequestHandler
@@ -97,6 +98,16 @@ class BasicTests(unittest.TestCase):
if (d1 != d2):
raise support.TestFailed("PEM-to-DER or DER-to-PEM translation failed")
+ @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):
def testConnect(self):