diff mercurial/sslutil.py @ 30644:d524c88511a7

py3: replace os.name with pycompat.osname (part 1 of 2) os.name returns unicodes on py3 and we have pycompat.osname which returns bytes. This series of 2 patches will change every ocurrence of os.name with pycompat.osname.
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 19 Dec 2016 00:16:52 +0530
parents 318a24b52eeb
children 16b5df5792a8
line wrap: on
line diff
--- a/mercurial/sslutil.py	Sun Dec 18 02:08:59 2016 +0530
+++ b/mercurial/sslutil.py	Mon Dec 19 00:16:52 2016 +0530
@@ -18,6 +18,7 @@
 from .i18n import _
 from . import (
     error,
+    pycompat,
     util,
 )
 
@@ -706,7 +707,7 @@
     # because we'll get a certificate verification error later and the lack
     # of loaded CA certificates will be the reason why.
     # Assertion: this code is only called if certificates are being verified.
-    if os.name == 'nt':
+    if pycompat.osname == 'nt':
         if not _canloaddefaultcerts:
             ui.warn(_('(unable to load Windows CA certificates; see '
                       'https://mercurial-scm.org/wiki/SecureConnections for '
@@ -737,7 +738,7 @@
     # / is writable on Windows. Out of an abundance of caution make sure
     # we're not on Windows because paths from _systemcacerts could be installed
     # by non-admin users.
-    assert os.name != 'nt'
+    assert pycompat.osname != 'nt'
 
     # Try to find CA certificates in well-known locations. We print a warning
     # when using a found file because we don't want too much silent magic