mirror of https://github.com/python/cpython
#9283: Fix repr(os.environ), display unicode keys and values on POSIX systems
This commit is contained in:
parent
aa5b33311a
commit
d73c1a3009
|
@ -446,7 +446,9 @@ class _Environ(MutableMapping):
|
|||
return len(self.data)
|
||||
|
||||
def __repr__(self):
|
||||
return 'environ({!r})'.format(self.data)
|
||||
return 'environ({})'.format(', '.join(
|
||||
('{!r}: {!r}'.format(self.decodekey(key), self.decodevalue(value))
|
||||
for key, value in self.data.items())))
|
||||
|
||||
def copy(self):
|
||||
return dict(self)
|
||||
|
|
Loading…
Reference in New Issue