Mercurial > public > mercurial-scm > hg-stable
diff mercurial/sslutil.py @ 30646:16b5df5792a8
py3: replace sys.platform with pycompat.sysplatform (part 1 of 2)
sys.platform returns unicode on python 3 world. Our code base has most of the
things bytes because of the transformer. So we have a bytes version of this as
pycompat.sysplatform. This series of 2 patches replaces occurences of
sys.platform with pycompat.sysplatform.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 19 Dec 2016 02:15:24 +0530 |
parents | d524c88511a7 |
children | 10b17ed9b591 |
line wrap: on
line diff
--- a/mercurial/sslutil.py Mon Dec 19 00:28:12 2016 +0530 +++ b/mercurial/sslutil.py Mon Dec 19 02:15:24 2016 +0530 @@ -668,7 +668,8 @@ for using system certificate store CAs in addition to the provided cacerts file """ - if sys.platform != 'darwin' or util.mainfrozen() or not sys.executable: + if (pycompat.sysplatform != 'darwin' or + util.mainfrozen() or not sys.executable): return False exe = os.path.realpath(sys.executable).lower() return (exe.startswith('/usr/bin/python') or @@ -725,7 +726,7 @@ # The Apple OpenSSL trick isn't available to us. If Python isn't able to # load system certs, we're out of luck. - if sys.platform == 'darwin': + if pycompat.sysplatform == 'darwin': # FUTURE Consider looking for Homebrew or MacPorts installed certs # files. Also consider exporting the keychain certs to a file during # Mercurial install.