Commit f5b46850 authored by Guido van Rossum's avatar Guido van Rossum

Reduce redundant calls to str() in _Environ class.

parent 67aca9e0
......@@ -424,8 +424,9 @@ else:
def __getitem__(self, key):
return self.data[self.keymap(key)]
def __setitem__(self, key, value):
self.putenv(key, str(value))
self.data[self.keymap(key)] = str(value)
value = str(value)
self.putenv(key, value)
self.data[self.keymap(key)] = value
def __delitem__(self, key):
self.unsetenv(key)
del self.data[self.keymap(key)]
......@@ -438,7 +439,7 @@ else:
return dict(self)
def setdefault(self, key, value):
if key not in self:
self[key] = str(value)
self[key] = value
return self[key]
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment