gh-114905: Remove redundant assignment in ssl._create_unverified_context() (GH-103625)

serhiy-storchaka <[email protected]> Mon, 10 Aug 2026 15:17:17 -0400 (EDT)
Newsgroups gmane.comp.python.cvs
Message-ID <[email protected]>
https://github.com/python/cpython/commit/7571c41da7505e6b551dae305b285af2a9139771
commit: 7571c41da7505e6b551dae305b285af2a9139771
branch: main
author: Mariusz Felisiak <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-08-10T19:15:45Z
summary:

gh-114905: Remove redundant assignment in ssl._create_unverified_context() (GH-103625)

files:
M Lib/ssl.py

diff --git a/Lib/ssl.py b/Lib/ssl.py
index 3c0361330d7e95..db66c59c05cc54 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -757,8 +757,6 @@ def _create_unverified_context(protocol=None, *, cert_reqs=CERT_NONE,
     context.check_hostname = check_hostname
     if cert_reqs is not None:
         context.verify_mode = cert_reqs
-    if check_hostname:
-        context.check_hostname = True
 
     if keyfile and not certfile:
         raise ValueError("certfile must be specified")

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]