Mercurial > hg
comparison tests/hghave.py @ 29107:c8fbfb9163ce
sslutil: move code examining _canloaddefaultcerts out of _defaultcacerts
Before, the return of _defaultcacerts() was 1 of 3 types. This was
difficult to read. Make it return a path or None.
We had to update hghave.py in the same patch because it was also
looking at this internal function. I wasted dozens of minutes
trying to figure out why tests were failing until I found the
code in hghave.py...
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 04 May 2016 23:38:34 -0700 |
parents | 67fd250b7c21 |
children | 47eab0cb72e3 |
comparison
equal
deleted
inserted
replaced
29106:fe7ebef8796a | 29107:c8fbfb9163ce |
---|---|
414 return False | 414 return False |
415 | 415 |
416 @check("defaultcacerts", "can verify SSL certs by system's CA certs store") | 416 @check("defaultcacerts", "can verify SSL certs by system's CA certs store") |
417 def has_defaultcacerts(): | 417 def has_defaultcacerts(): |
418 from mercurial import sslutil | 418 from mercurial import sslutil |
419 return sslutil._defaultcacerts() != '!' | 419 return sslutil._defaultcacerts() or sslutil._canloaddefaultcerts |
420 | 420 |
421 @check("windows", "Windows") | 421 @check("windows", "Windows") |
422 def has_windows(): | 422 def has_windows(): |
423 return os.name == 'nt' | 423 return os.name == 'nt' |
424 | 424 |