comparison mercurial/hgweb/wsgicgi.py @ 30636:f1c9fafcbf46

py3: replace os.environ with encoding.environ (part 3 of 5)
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 18 Dec 2016 01:54:36 +0530
parents 39d13b8c101d
children a57c938e7ac8
comparison
equal deleted inserted replaced
30635:a150173da1c1 30636:f1c9fafcbf46
8 # This was originally copied from the public domain code at 8 # This was originally copied from the public domain code at
9 # http://www.python.org/dev/peps/pep-0333/#the-server-gateway-side 9 # http://www.python.org/dev/peps/pep-0333/#the-server-gateway-side
10 10
11 from __future__ import absolute_import 11 from __future__ import absolute_import
12 12
13 import os
14
15 from .. import ( 13 from .. import (
14 encoding,
16 util, 15 util,
17 ) 16 )
18 17
19 from . import ( 18 from . import (
20 common, 19 common,
22 21
23 def launch(application): 22 def launch(application):
24 util.setbinary(util.stdin) 23 util.setbinary(util.stdin)
25 util.setbinary(util.stdout) 24 util.setbinary(util.stdout)
26 25
27 environ = dict(os.environ.iteritems()) 26 environ = dict(encoding.environ.iteritems())
28 environ.setdefault('PATH_INFO', '') 27 environ.setdefault('PATH_INFO', '')
29 if environ.get('SERVER_SOFTWARE', '').startswith('Microsoft-IIS'): 28 if environ.get('SERVER_SOFTWARE', '').startswith('Microsoft-IIS'):
30 # IIS includes script_name in PATH_INFO 29 # IIS includes script_name in PATH_INFO
31 scriptname = environ['SCRIPT_NAME'] 30 scriptname = environ['SCRIPT_NAME']
32 if environ['PATH_INFO'].startswith(scriptname): 31 if environ['PATH_INFO'].startswith(scriptname):