Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/pathutil.py @ 34261:cd022a11ec83
py3: use bytes os.sep in doctest of pathutil.py
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 17 Sep 2017 12:26:42 +0900 |
parents | 0fa781320203 |
children | f445b10dc7fb |
comparison
equal
deleted
inserted
replaced
34260:5ce32fe7df34 | 34261:cd022a11ec83 |
---|---|
201 For efficiency, this expects "path" argument to be already | 201 For efficiency, this expects "path" argument to be already |
202 normalized by "os.path.normpath", "os.path.realpath", and so on. | 202 normalized by "os.path.normpath", "os.path.realpath", and so on. |
203 | 203 |
204 See also issue3033 for detail about need of this function. | 204 See also issue3033 for detail about need of this function. |
205 | 205 |
206 >>> normasprefix(b'/foo/bar').replace(os.sep, b'/') | 206 >>> normasprefix(b'/foo/bar').replace(pycompat.ossep, b'/') |
207 '/foo/bar/' | 207 '/foo/bar/' |
208 >>> normasprefix(b'/').replace(os.sep, b'/') | 208 >>> normasprefix(b'/').replace(pycompat.ossep, b'/') |
209 '/' | 209 '/' |
210 ''' | 210 ''' |
211 d, p = os.path.splitdrive(path) | 211 d, p = os.path.splitdrive(path) |
212 if len(p) != len(pycompat.ossep): | 212 if len(p) != len(pycompat.ossep): |
213 return path + pycompat.ossep | 213 return path + pycompat.ossep |