Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9d54366

Browse files
committed
Only the test is merged in.
Merged revisions 80423 via svnmerge from svn+ssh://[email protected]/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ó. ........
1 parent ce2d24d commit 9d54366

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Lib/test/test_ssl.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import urllib.parse, urllib.request
1212
import traceback
1313
import asyncore
14+
import weakref
1415

1516
from http.server import HTTPServer, SimpleHTTPRequestHandler
1617

@@ -138,6 +139,16 @@ def test_ciphers(self):
138139
with self.assertRaisesRegexp(ssl.SSLError, "No cipher can be selected"):
139140
s.connect(remote)
140141

142+
@support.cpython_only
143+
def test_refcycle(self):
144+
# Issue #7943: an SSL object doesn't create reference cycles with
145+
# itself.
146+
s = socket.socket(socket.AF_INET)
147+
ss = ssl.wrap_socket(s)
148+
wr = weakref.ref(ss)
149+
del ss
150+
self.assertEqual(wr(), None)
151+
141152

142153
class NetworkedTests(unittest.TestCase):
143154

0 commit comments

Comments
 (0)