Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/ui.py @ 30528:20a42325fdef
py3: use pycompat.getcwd() instead of os.getcwd()
We have pycompat.getcwd() which returns bytes path on Python 3. This patch
changes most of the occurences of the os.getcwd() with pycompat one.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 23 Nov 2016 00:03:11 +0530 |
parents | b0a8337ba9af |
children | 4b0e6677eed1 |
comparison
equal
deleted
inserted
replaced
30527:a8b17859684a | 30528:20a42325fdef |
---|---|
25 config, | 25 config, |
26 encoding, | 26 encoding, |
27 error, | 27 error, |
28 formatter, | 28 formatter, |
29 progress, | 29 progress, |
30 pycompat, | |
30 scmutil, | 31 scmutil, |
31 util, | 32 util, |
32 ) | 33 ) |
33 | 34 |
34 urlreq = util.urlreq | 35 urlreq = util.urlreq |
225 | 226 |
226 def fixconfig(self, root=None, section=None): | 227 def fixconfig(self, root=None, section=None): |
227 if section in (None, 'paths'): | 228 if section in (None, 'paths'): |
228 # expand vars and ~ | 229 # expand vars and ~ |
229 # translate paths relative to root (or home) into absolute paths | 230 # translate paths relative to root (or home) into absolute paths |
230 root = root or os.getcwd() | 231 root = root or pycompat.getcwd() |
231 for c in self._tcfg, self._ucfg, self._ocfg: | 232 for c in self._tcfg, self._ucfg, self._ocfg: |
232 for n, p in c.items('paths'): | 233 for n, p in c.items('paths'): |
233 # Ignore sub-options. | 234 # Ignore sub-options. |
234 if ':' in n: | 235 if ':' in n: |
235 continue | 236 continue |