Mercurial > hg
comparison tests/hghave.py @ 44881:89f83e47e9c9
tests: remove "sslcontext" check
Now that we require the presence of ssl.SSLContext in setup.py, the check
would always return `True`.
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Sat, 30 May 2020 05:27:53 +0200 |
parents | ab5348bbc55e |
children | 62bdb288c449 |
comparison
equal
deleted
inserted
replaced
44880:7dd63a8cb1ee | 44881:89f83e47e9c9 |
---|---|
643 return True | 643 return True |
644 except ImportError: | 644 except ImportError: |
645 return False | 645 return False |
646 | 646 |
647 | 647 |
648 @check("sslcontext", "python >= 2.7.9 ssl") | |
649 def has_sslcontext(): | |
650 try: | |
651 import ssl | |
652 | |
653 ssl.SSLContext | |
654 return True | |
655 except (ImportError, AttributeError): | |
656 return False | |
657 | |
658 | |
659 @check("defaultcacertsloaded", "detected presence of loaded system CA certs") | 648 @check("defaultcacertsloaded", "detected presence of loaded system CA certs") |
660 def has_defaultcacertsloaded(): | 649 def has_defaultcacertsloaded(): |
661 import ssl | 650 import ssl |
662 from mercurial import sslutil, ui as uimod | 651 from mercurial import sslutil, ui as uimod |
663 | |
664 if not has_sslcontext(): | |
665 return False | |
666 | 652 |
667 ui = uimod.ui.load() | 653 ui = uimod.ui.load() |
668 cafile = sslutil._defaultcacerts(ui) | 654 cafile = sslutil._defaultcacerts(ui) |
669 ctx = ssl.create_default_context() | 655 ctx = ssl.create_default_context() |
670 if cafile: | 656 if cafile: |