comparison mercurial/sslutil.py @ 51310:03fc41fe8aa1

pytype: ignore certifi import error This is an optional import so we should not complains about it.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 19 Dec 2023 21:27:49 +0100
parents 18c8c18993f0
children 493034cc3265
comparison
equal deleted inserted replaced
51309:9c5bd485fbb6 51310:03fc41fe8aa1
785 CA certs because this scenario is detected at socket connect time. 785 CA certs because this scenario is detected at socket connect time.
786 """ 786 """
787 # The "certifi" Python package provides certificates. If it is installed 787 # The "certifi" Python package provides certificates. If it is installed
788 # and usable, assume the user intends it to be used and use it. 788 # and usable, assume the user intends it to be used and use it.
789 try: 789 try:
790 import certifi 790 import certifi # pytype: disable=import-error
791 791
792 certs = certifi.where() 792 certs = certifi.where()
793 if os.path.exists(certs): 793 if os.path.exists(certs):
794 ui.debug(b'using ca certificates from certifi\n') 794 ui.debug(b'using ca certificates from certifi\n')
795 return pycompat.fsencode(certs) 795 return pycompat.fsencode(certs)