diff mercurial/sslutil.py @ 34647:dacfcdd8b94e

codemod: use pycompat.isdarwin This is done by: sed -i "s/pycompat\.sysplatform == 'darwin'/pycompat.isdarwin/" **/*.py Plus a manual change to `sslutil.py` which involves indentation change that cannot be done by `sed`. Differential Revision: https://phab.mercurial-scm.org/D1035
author Jun Wu <quark@fb.com>
date Thu, 12 Oct 2017 23:34:34 -0700
parents 75979c8d4572
children 8c1d0fe1f431
line wrap: on
line diff
--- a/mercurial/sslutil.py	Thu Oct 12 09:04:22 2017 -0700
+++ b/mercurial/sslutil.py	Thu Oct 12 23:34:34 2017 -0700
@@ -677,8 +677,8 @@
       for using system certificate store CAs in addition to the provided
       cacerts file
     """
-    if (pycompat.sysplatform != 'darwin' or
-                        util.mainfrozen() or not pycompat.sysexecutable):
+    if (not pycompat.isdarwin or util.mainfrozen() or
+        not pycompat.sysexecutable):
         return False
     exe = os.path.realpath(pycompat.sysexecutable).lower()
     return (exe.startswith('/usr/bin/python') or
@@ -736,7 +736,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 pycompat.sysplatform == 'darwin':
+    if pycompat.isdarwin:
         # FUTURE Consider looking for Homebrew or MacPorts installed certs
         # files. Also consider exporting the keychain certs to a file during
         # Mercurial install.