diff mercurial/pycompat.py @ 30820:6a70cf94d1b5

py3: replace pycompat.getenv with encoding.environ.get pycompat.getenv returns os.getenvb on py3 which is not available on Windows. This patch replaces them with encoding.environ.get and checks to ensure no new instances of os.getenv or os.setenv are introduced.
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 15 Jan 2017 13:17:05 +0530
parents caf7e1c5efe4
children 76a64c1e5439 86cd1f2cfff5
line wrap: on
line diff
--- a/mercurial/pycompat.py	Sun Jan 15 16:33:15 2017 +0900
+++ b/mercurial/pycompat.py	Sun Jan 15 13:17:05 2017 +0530
@@ -46,7 +46,6 @@
     ospathsep = os.pathsep.encode('ascii')
     ossep = os.sep.encode('ascii')
     osaltsep = os.altsep
-    osgetenv = os.getenvb
     if osaltsep:
         osaltsep = osaltsep.encode('ascii')
     # os.getcwd() on Python 3 returns string, but it has os.getcwdb() which
@@ -169,7 +168,6 @@
     sysargv = sys.argv
     sysplatform = sys.platform
     getcwd = os.getcwd
-    osgetenv = os.getenv
     sysexecutable = sys.executable
     shlexsplit = shlex.split