blob: 96882712e957e98b7a60659f2f72e3323a030307 [file] [log] [blame]
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08001From 0e1f3856a7e1511fb64d99646c54ddf3897cd444 Mon Sep 17 00:00:00 2001
2From: Dimitri John Ledkov <xnox@ubuntu.com>
3Date: Fri, 28 Sep 2018 14:15:52 +0100
4Subject: [PATCH 2/4] bpo-34818: Add missing closing() wrapper in test_tls1_3.
5
6Python 2.7 socket classes do not implement context manager protocol,
7hence closing() is required around it. Resolves testcase error
8traceback.
9
10Signed-off-by: Dimitri John Ledkov <xnox@ubuntu.com>
11
12https://bugs.python.org/issue34818
13
14Patch taken from Ubuntu.
15
16Upstream-Status: Submitted [https://github.com/python/cpython/pull/9622]
17Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
18---
19 Lib/test/test_ssl.py | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
23index f51572e319..7a14053cee 100644
24--- a/Lib/test/test_ssl.py
25+++ b/Lib/test/test_ssl.py
26@@ -2817,7 +2817,7 @@ else:
27 ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 | ssl.OP_NO_TLSv1_2
28 )
29 with ThreadedEchoServer(context=context) as server:
30- with context.wrap_socket(socket.socket()) as s:
31+ with closing(context.wrap_socket(socket.socket())) as s:
32 s.connect((HOST, server.port))
33 self.assertIn(s.cipher()[0], [
34 'TLS_AES_256_GCM_SHA384',
35--
362.17.1
37