diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-08-23 19:19:15 +0200 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-08-23 19:19:15 +0200 |
commit | 7549e8f6529ab47e84253442819f40e4f092b679 (patch) | |
tree | 45aeb843b8612bd9c8622519ff9625414cd1dbd5 /Lib/os.py | |
parent | 921824c2f9311561e22ad100b8de5460da72bc26 (diff) | |
download | cpython-7549e8f6529ab47e84253442819f40e4f092b679.tar.gz |
Close #17702: On error, os.environb now removes suppress the except context
when raising a new KeyError with the original key.
Diffstat (limited to 'Lib/os.py')
-rw-r--r-- | Lib/os.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -673,7 +673,7 @@ class _Environ(MutableMapping): value = self._data[self.encodekey(key)] except KeyError: # raise KeyError with the original key value - raise KeyError(key) + raise KeyError(key) from None return self.decodevalue(value) def __setitem__(self, key, value): @@ -689,7 +689,7 @@ class _Environ(MutableMapping): del self._data[encodedkey] except KeyError: # raise KeyError with the original key value - raise KeyError(key) + raise KeyError(key) from None def __iter__(self): for key in self._data: |