changeset 21291:007d276f8c94

py3kcompat: don't convert os.environ to bytes os.environ accepts str not bytes. Assigning bytes will result in a run-time error.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 10 May 2014 15:22:04 -0700
parents 74be3fb1e3b8
children a7a9d84f5e4a
files mercurial/py3kcompat.py
diffstat 1 files changed, 0 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/py3kcompat.py	Sat May 10 14:57:25 2014 -0700
+++ b/mercurial/py3kcompat.py	Sat May 10 15:22:04 2014 -0700
@@ -52,13 +52,6 @@
     return ret.encode('utf-8', 'surrogateescape')
 builtins.bytesformatter = bytesformatter
 
-# Create bytes equivalents for os.environ values
-for key in list(os.environ.keys()):
-    # UTF-8 is fine for us
-    bkey = key.encode('utf-8', 'surrogateescape')
-    bvalue = os.environ[key].encode('utf-8', 'surrogateescape')
-    os.environ[bkey] = bvalue
-
 origord = builtins.ord
 def fakeord(char):
     if isinstance(char, int):