Skip to content

Commit a5669b3

Browse files
authored
bpo-43998: Fix testing without ssl module (GH-25790)
Signed-off-by: Christian Heimes <[email protected]>
1 parent 9a42d50 commit a5669b3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/test/test_nntplib.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,10 @@ class NetworkedNNTP_SSLTests(NetworkedNNTPTests):
368368
# Disabled as the connection will already be encrypted.
369369
test_starttls = None
370370

371-
ssl_context = ssl._create_unverified_context()
372-
ssl_context.set_ciphers("DEFAULT")
373-
ssl_context.maximum_version = ssl.TLSVersion.TLSv1_2
371+
if ssl is not None:
372+
ssl_context = ssl._create_unverified_context()
373+
ssl_context.set_ciphers("DEFAULT")
374+
ssl_context.maximum_version = ssl.TLSVersion.TLSv1_2
374375

375376
#
376377
# Non-networked tests using a local server (or something mocking it).

0 commit comments

Comments
 (0)