diff mercurial/scmutil.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 4338f87dbf6f
children 0b8356705de6
line wrap: on
line diff
--- a/mercurial/scmutil.py	Sun Dec 18 02:08:59 2016 +0530
+++ b/mercurial/scmutil.py	Mon Dec 19 00:16:52 2016 +0530
@@ -34,7 +34,7 @@
     util,
 )
 
-if os.name == 'nt':
+if pycompat.osname == 'nt':
     from . import scmwindows as scmplatform
 else:
     from . import scmposix as scmplatform
@@ -281,7 +281,7 @@
     val = ui.config('ui', 'portablefilenames', 'warn')
     lval = val.lower()
     bval = util.parsebool(val)
-    abort = os.name == 'nt' or lval == 'abort'
+    abort = pycompat.osname == 'nt' or lval == 'abort'
     warn = bval or lval == 'warn'
     if bval is None and not (warn or abort or lval == 'ignore'):
         raise error.ConfigError(
@@ -1461,7 +1461,7 @@
 
         # Only Windows/NTFS has slow file closing. So only enable by default
         # on that platform. But allow to be enabled elsewhere for testing.
-        defaultenabled = os.name == 'nt'
+        defaultenabled = pycompat.osname == 'nt'
         enabled = ui.configbool('worker', 'backgroundclose', defaultenabled)
 
         if not enabled: