comparison mercurial/scmwindows.py @ 30637:344e68882cd3

py3: replace os.environ with encoding.environ (part 4 of 5)
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 18 Dec 2016 02:06:00 +0530
parents d623cc6b3742
children bf5e13e38390
comparison
equal deleted inserted replaced
30636:f1c9fafcbf46 30637:344e68882cd3
1 from __future__ import absolute_import 1 from __future__ import absolute_import
2 2
3 import os 3 import os
4 4
5 from . import ( 5 from . import (
6 encoding,
6 osutil, 7 osutil,
7 pycompat, 8 pycompat,
8 util, 9 util,
9 win32, 10 win32,
10 ) 11 )
46 def userrcpath(): 47 def userrcpath():
47 '''return os-specific hgrc search path to the user dir''' 48 '''return os-specific hgrc search path to the user dir'''
48 home = os.path.expanduser('~') 49 home = os.path.expanduser('~')
49 path = [os.path.join(home, 'mercurial.ini'), 50 path = [os.path.join(home, 'mercurial.ini'),
50 os.path.join(home, '.hgrc')] 51 os.path.join(home, '.hgrc')]
51 userprofile = os.environ.get('USERPROFILE') 52 userprofile = encoding.environ.get('USERPROFILE')
52 if userprofile and userprofile != home: 53 if userprofile and userprofile != home:
53 path.append(os.path.join(userprofile, 'mercurial.ini')) 54 path.append(os.path.join(userprofile, 'mercurial.ini'))
54 path.append(os.path.join(userprofile, '.hgrc')) 55 path.append(os.path.join(userprofile, '.hgrc'))
55 return path 56 return path
56 57