Mercurial > public > mercurial-scm > hg-stable
diff mercurial/posix.py @ 30619:cfe66dcf45c0
py3: replace os.sep with pycompat.ossep (part 2 of 4)
This part also replaces some chunks of os.sep with pycompat.ossep.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 17 Dec 2016 20:02:50 +0530 |
parents | d623cc6b3742 |
children | ad15646dc61c |
line wrap: on
line diff
--- a/mercurial/posix.py Sat Dec 17 19:56:30 2016 +0530 +++ b/mercurial/posix.py Sat Dec 17 20:02:50 2016 +0530 @@ -369,7 +369,7 @@ # use upper-ing as normcase as same as NTFS workaround def normcase(path): pathlen = len(path) - if (pathlen == 0) or (path[0] != os.sep): + if (pathlen == 0) or (path[0] != pycompat.ossep): # treat as relative return encoding.upper(path) @@ -381,7 +381,7 @@ mplen = len(mp) if mplen == pathlen: # mount point itself return mp - if path[mplen] == os.sep: + if path[mplen] == pycompat.ossep: return mp + encoding.upper(path[mplen:]) return encoding.upper(path) @@ -456,7 +456,7 @@ return executable return None - if os.sep in command: + if pycompat.ossep in command: return findexisting(command) if sys.platform == 'plan9':