Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/pathutil.py @ 34146:0fa781320203
doctest: bulk-replace string literals with b'' for Python 3
Our code transformer can't rewrite string literals in docstrings, and I
don't want to make the transformer more complex.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 03 Sep 2017 14:32:11 +0900 |
parents | 377e8ddaebef |
children | cd022a11ec83 |
comparison
equal
deleted
inserted
replaced
34145:ada8a19672ab | 34146:0fa781320203 |
---|---|
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('/foo/bar').replace(os.sep, '/') | 206 >>> normasprefix(b'/foo/bar').replace(os.sep, b'/') |
207 '/foo/bar/' | 207 '/foo/bar/' |
208 >>> normasprefix('/').replace(os.sep, '/') | 208 >>> normasprefix(b'/').replace(os.sep, 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 |