comparison hgext/pager.py @ 30635:a150173da1c1

py3: replace os.environ with encoding.environ (part 2 of 5)
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 18 Dec 2016 01:46:39 +0530
parents 39d13b8c101d
children 117e15c30e6c
comparison
equal deleted inserted replaced
30634:ad15646dc61c 30635:a150173da1c1
69 from mercurial.i18n import _ 69 from mercurial.i18n import _
70 from mercurial import ( 70 from mercurial import (
71 cmdutil, 71 cmdutil,
72 commands, 72 commands,
73 dispatch, 73 dispatch,
74 encoding,
74 extensions, 75 extensions,
75 util, 76 util,
76 ) 77 )
77 78
78 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for 79 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
121 argv = sys.argv[:] 122 argv = sys.argv[:]
122 if 'chgunix' in dispatch._earlygetopt(['--cmdserver'], argv): 123 if 'chgunix' in dispatch._earlygetopt(['--cmdserver'], argv):
123 return 124 return
124 125
125 def pagecmd(orig, ui, options, cmd, cmdfunc): 126 def pagecmd(orig, ui, options, cmd, cmdfunc):
126 p = ui.config("pager", "pager", os.environ.get("PAGER")) 127 p = ui.config("pager", "pager", encoding.environ.get("PAGER"))
127 usepager = False 128 usepager = False
128 always = util.parsebool(options['pager']) 129 always = util.parsebool(options['pager'])
129 auto = options['pager'] == 'auto' 130 auto = options['pager'] == 'auto'
130 131
131 if not p: 132 if not p: