Mercurial > public > mercurial-scm > hg-stable
comparison 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 |
comparison
equal
deleted
inserted
replaced
30645:7a3e67bfa417 | 30646:16b5df5792a8 |
---|---|
3888 if textwidth <= 0 or termwidth < textwidth: | 3888 if textwidth <= 0 or termwidth < textwidth: |
3889 textwidth = termwidth | 3889 textwidth = termwidth |
3890 | 3890 |
3891 keep = opts.get('system') or [] | 3891 keep = opts.get('system') or [] |
3892 if len(keep) == 0: | 3892 if len(keep) == 0: |
3893 if sys.platform.startswith('win'): | 3893 if pycompat.sysplatform.startswith('win'): |
3894 keep.append('windows') | 3894 keep.append('windows') |
3895 elif sys.platform == 'OpenVMS': | 3895 elif pycompat.sysplatform == 'OpenVMS': |
3896 keep.append('vms') | 3896 keep.append('vms') |
3897 elif sys.platform == 'plan9': | 3897 elif pycompat.sysplatform == 'plan9': |
3898 keep.append('plan9') | 3898 keep.append('plan9') |
3899 else: | 3899 else: |
3900 keep.append('unix') | 3900 keep.append('unix') |
3901 keep.append(sys.platform.lower()) | 3901 keep.append(pycompat.sysplatform.lower()) |
3902 if ui.verbose: | 3902 if ui.verbose: |
3903 keep.append('verbose') | 3903 keep.append('verbose') |
3904 | 3904 |
3905 section = None | 3905 section = None |
3906 subtopic = None | 3906 subtopic = None |