From 9be5c14a5777b710a32725f0adf6ff893d2a46ae Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 9 Jul 2019 13:06:20 +0200 Subject: [PATCH] bpo-37322: Fix again test_ssl.test_pha_required_nocert() ResourceWarning test_ssl.test_pha_required_nocert(): only close the TLS connection at the server side once the handler completed. --- Lib/test/test_ssl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 166e28683e267f..5170535288508e 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -2382,7 +2382,6 @@ def run(self): if self.server.chatty and support.verbose: sys.stdout.write(err.args[1]) # test_pha_required_nocert is expecting this exception - self.close() raise ssl.SSLError('tlsv13 alert certificate required') except OSError: if self.server.chatty: @@ -2460,6 +2459,7 @@ def run(self): handler = self.ConnectionHandler(self, newconn, connaddr) handler.start() handler.join() + handler.close() except socket.timeout: pass except KeyboardInterrupt: