mercurial/encoding.py
changeset 39818 24e493ec2229
parent 38783 e7aa113b14f7
child 39819 fb628c048d64
equal deleted inserted replaced
39817:94c25f694ec3 39818:24e493ec2229
   230 if not _nativeenviron:
   230 if not _nativeenviron:
   231     # now encoding and helper functions are available, recreate the environ
   231     # now encoding and helper functions are available, recreate the environ
   232     # dict to be exported to other modules
   232     # dict to be exported to other modules
   233     environ = dict((tolocal(k.encode(u'utf-8')), tolocal(v.encode(u'utf-8')))
   233     environ = dict((tolocal(k.encode(u'utf-8')), tolocal(v.encode(u'utf-8')))
   234                    for k, v in os.environ.items())  # re-exports
   234                    for k, v in os.environ.items())  # re-exports
       
   235 
       
   236 if pycompat.ispy3:
       
   237     # os.getcwd() on Python 3 returns string, but it has os.getcwdb() which
       
   238     # returns bytes.
       
   239     getcwd = os.getcwdb  # re-exports
       
   240 else:
       
   241     getcwd = os.getcwd  # re-exports
   235 
   242 
   236 # How to treat ambiguous-width characters. Set to 'wide' to treat as wide.
   243 # How to treat ambiguous-width characters. Set to 'wide' to treat as wide.
   237 _wide = _sysstr(environ.get("HGENCODINGAMBIGUOUS", "narrow") == "wide"
   244 _wide = _sysstr(environ.get("HGENCODINGAMBIGUOUS", "narrow") == "wide"
   238                 and "WFA" or "WF")
   245                 and "WFA" or "WF")
   239 
   246