# HG changeset patch # User Jun Wu # Date 1507824262 25200 # Node ID 238abf65a8ad653a5ce14287609185f3687618ec # Parent 75979c8d457288b4c049f730a303345e4317e38a codemod: use pycompat.isposix This is done by: sed -i "s/pycompat\.osname == 'posix'/pycompat.isposix/" **/*.py Differential Revision: https://phab.mercurial-scm.org/D1036 diff -r 75979c8d4572 -r 238abf65a8ad hgext/largefiles/lfutil.py --- a/hgext/largefiles/lfutil.py Thu Oct 12 23:30:46 2017 -0700 +++ b/hgext/largefiles/lfutil.py Thu Oct 12 09:04:22 2017 -0700 @@ -83,7 +83,7 @@ home = encoding.environ.get('HOME') if home: return os.path.join(home, 'Library', 'Caches', longname) - elif pycompat.osname == 'posix': + elif pycompat.isposix: path = encoding.environ.get('XDG_CACHE_HOME') if path: return os.path.join(path, longname) diff -r 75979c8d4572 -r 238abf65a8ad mercurial/util.py --- a/mercurial/util.py Thu Oct 12 23:30:46 2017 -0700 +++ b/mercurial/util.py Thu Oct 12 09:04:22 2017 -0700 @@ -313,7 +313,7 @@ return memoryview(sliceable)[offset:offset + length] return memoryview(sliceable)[offset:] -closefds = pycompat.osname == 'posix' +closefds = pycompat.isposix _chunksize = 4096 diff -r 75979c8d4572 -r 238abf65a8ad mercurial/worker.py --- a/mercurial/worker.py Thu Oct 12 23:30:46 2017 -0700 +++ b/mercurial/worker.py Thu Oct 12 09:04:22 2017 -0700 @@ -53,7 +53,7 @@ raise error.Abort(_('number of cpus must be an integer')) return min(max(countcpus(), 4), 32) -if pycompat.osname == 'posix': +if pycompat.isposix: _startupcost = 0.01 else: _startupcost = 1e30