diff mercurial/worker.py @ 30639: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 a150173da1c1
children 48dea083f66d 18fb3cf572b4
line wrap: on
line diff
--- a/mercurial/worker.py	Sun Dec 18 02:08:59 2016 +0530
+++ b/mercurial/worker.py	Mon Dec 19 00:16:52 2016 +0530
@@ -16,6 +16,7 @@
 from . import (
     encoding,
     error,
+    pycompat,
     scmutil,
     util,
 )
@@ -52,7 +53,7 @@
             raise error.Abort(_('number of cpus must be an integer'))
     return min(max(countcpus(), 4), 32)
 
-if os.name == 'posix':
+if pycompat.osname == 'posix':
     _startupcost = 0.01
 else:
     _startupcost = 1e30
@@ -186,7 +187,7 @@
     elif os.WIFSIGNALED(code):
         return -os.WTERMSIG(code)
 
-if os.name != 'nt':
+if pycompat.osname != 'nt':
     _platformworker = _posixworker
     _exitstatus = _posixexitstatus