diff options
author | Guido van Rossum <guido@python.org> | 2007-06-13 21:52:41 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-06-13 21:52:41 (GMT) |
commit | f5b46850e6b5bab2b2afa8858bdb6446f9adc6eb (patch) | |
tree | 5575fb5d17aa893eb6b0933568c0d3cdbf7a6235 /Lib | |
parent | 67aca9e04e5360007c46fde3d64debb4dad4d9ff (diff) | |
download | cpython-f5b46850e6b5bab2b2afa8858bdb6446f9adc6eb.zip cpython-f5b46850e6b5bab2b2afa8858bdb6446f9adc6eb.tar.gz cpython-f5b46850e6b5bab2b2afa8858bdb6446f9adc6eb.tar.bz2 |
Reduce redundant calls to str() in _Environ class.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/os.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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: |