[Python-checkins] bpo-43998: Fix testing without ssl module (GH-25790)

tiran webhook-mailer at python.org
Sat May 1 16:17:08 EDT 2021


https://github.com/python/cpython/commit/a5669b3c627e64c9196d9bb58b733eb723d34e99
commit: a5669b3c627e64c9196d9bb58b733eb723d34e99
branch: master
author: Christian Heimes <christian at python.org>
committer: tiran <christian at python.org>
date: 2021-05-01T22:17:01+02:00
summary:

bpo-43998: Fix testing without ssl module (GH-25790)

Signed-off-by: Christian Heimes <christian at python.org>

files:
M Lib/test/test_nntplib.py

diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py
index 19509463a2ba1..4f0592188f844 100644
--- a/Lib/test/test_nntplib.py
+++ b/Lib/test/test_nntplib.py
@@ -368,9 +368,10 @@ class NetworkedNNTP_SSLTests(NetworkedNNTPTests):
     # Disabled as the connection will already be encrypted.
     test_starttls = None
 
-    ssl_context = ssl._create_unverified_context()
-    ssl_context.set_ciphers("DEFAULT")
-    ssl_context.maximum_version = ssl.TLSVersion.TLSv1_2
+    if ssl is not None:
+        ssl_context = ssl._create_unverified_context()
+        ssl_context.set_ciphers("DEFAULT")
+        ssl_context.maximum_version = ssl.TLSVersion.TLSv1_2
 
 #
 # Non-networked tests using a local server (or something mocking it).



More information about the Python-checkins mailing list