Mercurial > public > mercurial-scm > hg
comparison mercurial/scmwindows.py @ 30612:d623cc6b3742
py3: replace os.pathsep with pycompat.ospathsep
os.pathsep returns unicode on Python 3. We already have pycompat.ospathsep
which return bytes on Python 3. This patch replaces all the occurrences of
os.pathsep in the codebase (excluding tests) to pycompat.ospathsep.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 17 Dec 2016 19:47:17 +0530 |
parents | 365812902904 |
children | 344e68882cd3 |
comparison
equal
deleted
inserted
replaced
30611:cbc61b1b52ea | 30612:d623cc6b3742 |
---|---|
2 | 2 |
3 import os | 3 import os |
4 | 4 |
5 from . import ( | 5 from . import ( |
6 osutil, | 6 osutil, |
7 pycompat, | |
7 util, | 8 util, |
8 win32, | 9 win32, |
9 ) | 10 ) |
10 | 11 |
11 try: | 12 try: |
31 value = util.lookupreg('SOFTWARE\\Mercurial', None, | 32 value = util.lookupreg('SOFTWARE\\Mercurial', None, |
32 winreg.HKEY_LOCAL_MACHINE) | 33 winreg.HKEY_LOCAL_MACHINE) |
33 if not isinstance(value, str) or not value: | 34 if not isinstance(value, str) or not value: |
34 return rcpath | 35 return rcpath |
35 value = util.localpath(value) | 36 value = util.localpath(value) |
36 for p in value.split(os.pathsep): | 37 for p in value.split(pycompat.ospathsep): |
37 if p.lower().endswith('mercurial.ini'): | 38 if p.lower().endswith('mercurial.ini'): |
38 rcpath.append(p) | 39 rcpath.append(p) |
39 elif os.path.isdir(p): | 40 elif os.path.isdir(p): |
40 for f, kind in osutil.listdir(p): | 41 for f, kind in osutil.listdir(p): |
41 if f.endswith('.rc'): | 42 if f.endswith('.rc'): |