]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43998: Fix testing without ssl module (GH-25790)
authorChristian Heimes <christian@python.org>
Sat, 1 May 2021 20:17:01 +0000 (22:17 +0200)
committerGitHub <noreply@github.com>
Sat, 1 May 2021 20:17:01 +0000 (22:17 +0200)
Signed-off-by: Christian Heimes <christian@python.org>
Lib/test/test_nntplib.py

index 19509463a2ba1322275498758a0ac041e3cf9b16..4f0592188f84438cb863062dd12b1c2bf6622aa4 100644 (file)
@@ -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).