##// END OF EJS Templates
py3: replace os.getenv with pycompat.osgetenv...
Pulkit Goyal -
r30664:69acfd2c default
parent child Browse files
Show More
@@ -74,18 +74,19 b' def _usercachedir(ui):'
74 74 if path:
75 75 return path
76 76 if pycompat.osname == 'nt':
77 appdata = os.getenv('LOCALAPPDATA', os.getenv('APPDATA'))
77 appdata = pycompat.osgetenv('LOCALAPPDATA',\
78 pycompat.osgetenv('APPDATA'))
78 79 if appdata:
79 80 return os.path.join(appdata, longname)
80 81 elif platform.system() == 'Darwin':
81 home = os.getenv('HOME')
82 home = pycompat.osgetenv('HOME')
82 83 if home:
83 84 return os.path.join(home, 'Library', 'Caches', longname)
84 85 elif pycompat.osname == 'posix':
85 path = os.getenv('XDG_CACHE_HOME')
86 path = pycompat.osgetenv('XDG_CACHE_HOME')
86 87 if path:
87 88 return os.path.join(path, longname)
88 home = os.getenv('HOME')
89 home = pycompat.osgetenv('HOME')
89 90 if home:
90 91 return os.path.join(home, '.cache', longname)
91 92 else:
@@ -8,12 +8,12 b''
8 8 from __future__ import absolute_import, print_function
9 9
10 10 import contextlib
11 import os
12 11 import time
13 12
14 13 from .i18n import _
15 14 from . import (
16 15 error,
16 pycompat,
17 17 util,
18 18 )
19 19
@@ -120,7 +120,7 b' def profile(ui):'
120 120 Profiling is active when the context manager is active. When the context
121 121 manager exits, profiling results will be written to the configured output.
122 122 """
123 profiler = os.getenv('HGPROF')
123 profiler = pycompat.osgetenv('HGPROF')
124 124 if profiler is None:
125 125 profiler = ui.config('profiling', 'type', default='stat')
126 126 if profiler not in ('ls', 'stat', 'flame'):
@@ -18,6 +18,7 b' from . import ('
18 18 error,
19 19 httpconnection as httpconnectionmod,
20 20 keepalive,
21 pycompat,
21 22 sslutil,
22 23 util,
23 24 )
@@ -79,7 +80,8 b' class passwordmgr(object):'
79 80
80 81 class proxyhandler(urlreq.proxyhandler):
81 82 def __init__(self, ui):
82 proxyurl = ui.config("http_proxy", "host") or os.getenv('http_proxy')
83 proxyurl = (ui.config("http_proxy", "host") or
84 pycompat.osgetenv('http_proxy'))
83 85 # XXX proxyauthinfo = None
84 86
85 87 if proxyurl:
@@ -97,7 +99,7 b' class proxyhandler(urlreq.proxyhandler):'
97 99 no_list.extend([p.lower() for
98 100 p in ui.configlist("http_proxy", "no")])
99 101 no_list.extend([p.strip().lower() for
100 p in os.getenv("no_proxy", '').split(',')
102 p in pycompat.osgetenv("no_proxy", '').split(',')
101 103 if p.strip()])
102 104 # "http_proxy.always" config is for running tests on localhost
103 105 if ui.configbool("http_proxy", "always"):
General Comments 0
You need to be logged in to leave comments. Login now