mercurial/encoding.py
changeset 39823 24e493ec2229
parent 38823 e7aa113b14f7
child 39824 fb628c048d64
--- a/mercurial/encoding.py	Mon Sep 24 22:46:22 2018 -0400
+++ b/mercurial/encoding.py	Fri Sep 21 19:48:23 2018 -0400
@@ -233,6 +233,13 @@
     environ = dict((tolocal(k.encode(u'utf-8')), tolocal(v.encode(u'utf-8')))
                    for k, v in os.environ.items())  # re-exports
 
+if pycompat.ispy3:
+    # os.getcwd() on Python 3 returns string, but it has os.getcwdb() which
+    # returns bytes.
+    getcwd = os.getcwdb  # re-exports
+else:
+    getcwd = os.getcwd  # re-exports
+
 # How to treat ambiguous-width characters. Set to 'wide' to treat as wide.
 _wide = _sysstr(environ.get("HGENCODINGAMBIGUOUS", "narrow") == "wide"
                 and "WFA" or "WF")