diff options
author | Christian Heimes <christian@python.org> | 2021-05-01 20:17:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-01 20:17:01 (GMT) |
commit | a5669b3c627e64c9196d9bb58b733eb723d34e99 (patch) | |
tree | 61e392a416e592a6255691f9052a8a6d916f1bd1 | |
parent | 9a42d5069a4c2a531076abfb198d2be26b57216c (diff) | |
download | cpython-a5669b3c627e64c9196d9bb58b733eb723d34e99.zip cpython-a5669b3c627e64c9196d9bb58b733eb723d34e99.tar.gz cpython-a5669b3c627e64c9196d9bb58b733eb723d34e99.tar.bz2 |
bpo-43998: Fix testing without ssl module (GH-25790)
Signed-off-by: Christian Heimes <christian@python.org>
-rw-r--r-- | Lib/test/test_nntplib.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py index 1950946..4f05921 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). |