summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-08-23 17:23:42 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-08-23 17:23:42 (GMT)
commita93c6db68bbb5070398b6cdb029a9bf0365846fc (patch)
tree9e807583a6cc0ee68e10985974a111ae548ce343 /Lib/os.py
parent330cc52c99037eaabe0fcfa09f9b099743b0b913 (diff)
parent0c2dd0c0a9498422645a2805a955b9a898298bc6 (diff)
downloadcpython-a93c6db68bbb5070398b6cdb029a9bf0365846fc.zip
cpython-a93c6db68bbb5070398b6cdb029a9bf0365846fc.tar.gz
cpython-a93c6db68bbb5070398b6cdb029a9bf0365846fc.tar.bz2
(Merge 3.3) 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.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/os.py b/Lib/os.py
index 96720e4..5fde360 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -648,7 +648,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):
@@ -664,7 +664,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: