Mercurial > public > mercurial-scm > hg
diff mercurial/color.py @ 34645:75979c8d4572
codemod: use pycompat.iswindows
This is done by:
sed -i "s/pycompat\.osname == 'nt'/pycompat.iswindows/" **/*.py
sed -i "s/pycompat\.osname != 'nt'/not pycompat.iswindows/" **/*.py
sed -i 's/pycompat.osname == "nt"/pycompat.iswindows/' **/*.py
Differential Revision: https://phab.mercurial-scm.org/D1034
author | Jun Wu <quark@fb.com> |
---|---|
date | Thu, 12 Oct 2017 23:30:46 -0700 |
parents | a57c938e7ac8 |
children | d4805a5e7e70 |
line wrap: on
line diff
--- a/mercurial/color.py Thu Oct 12 19:20:04 2017 -0700 +++ b/mercurial/color.py Thu Oct 12 23:30:46 2017 -0700 @@ -210,7 +210,7 @@ mode = ui.config('color', 'pagermode', mode) realmode = mode - if pycompat.osname == 'nt': + if pycompat.iswindows: from . import win32 term = encoding.environ.get('TERM') @@ -379,7 +379,7 @@ return msg w32effects = None -if pycompat.osname == 'nt': +if pycompat.iswindows: import ctypes _kernel32 = ctypes.windll.kernel32