Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 30646:16b5df5792a8
py3: replace sys.platform with pycompat.sysplatform (part 1 of 2)
sys.platform returns unicode on python 3 world. Our code base has most of the
things bytes because of the transformer. So we have a bytes version of this as
pycompat.sysplatform. This series of 2 patches replaces occurences of
sys.platform with pycompat.sysplatform.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 19 Dec 2016 02:15:24 +0530 |
parents | 201b44c8875c |
children | 10b17ed9b591 |
line wrap: on
line diff
--- a/mercurial/commands.py Mon Dec 19 00:28:12 2016 +0530 +++ b/mercurial/commands.py Mon Dec 19 02:15:24 2016 +0530 @@ -3890,15 +3890,15 @@ keep = opts.get('system') or [] if len(keep) == 0: - if sys.platform.startswith('win'): + if pycompat.sysplatform.startswith('win'): keep.append('windows') - elif sys.platform == 'OpenVMS': + elif pycompat.sysplatform == 'OpenVMS': keep.append('vms') - elif sys.platform == 'plan9': + elif pycompat.sysplatform == 'plan9': keep.append('plan9') else: keep.append('unix') - keep.append(sys.platform.lower()) + keep.append(pycompat.sysplatform.lower()) if ui.verbose: keep.append('verbose')