Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/sslutil.py @ 29488:1c26b9ce66f8
sslutil: expand _defaultcacerts docstring to note calling assumptions
We should document this so future message additions don't seem out
of place.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Thu, 30 Jun 2016 19:54:12 -0700 |
parents | cdcb5747dc88 |
children | 54ad81b0665f |
comparison
equal
deleted
inserted
replaced
29487:cdcb5747dc88 | 29488:1c26b9ce66f8 |
---|---|
429 exe = os.path.realpath(sys.executable).lower() | 429 exe = os.path.realpath(sys.executable).lower() |
430 return (exe.startswith('/usr/bin/python') or | 430 return (exe.startswith('/usr/bin/python') or |
431 exe.startswith('/system/library/frameworks/python.framework/')) | 431 exe.startswith('/system/library/frameworks/python.framework/')) |
432 | 432 |
433 def _defaultcacerts(ui): | 433 def _defaultcacerts(ui): |
434 """return path to default CA certificates or None.""" | 434 """return path to default CA certificates or None. |
435 | |
436 It is assumed this function is called when the returned certificates | |
437 file will actually be used to validate connections. Therefore this | |
438 function may print warnings or debug messages assuming this usage. | |
439 """ | |
435 # The "certifi" Python package provides certificates. If it is installed, | 440 # The "certifi" Python package provides certificates. If it is installed, |
436 # assume the user intends it to be used and use it. | 441 # assume the user intends it to be used and use it. |
437 try: | 442 try: |
438 import certifi | 443 import certifi |
439 certs = certifi.where() | 444 certs = certifi.where() |