summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-08-23 17:19:15 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-08-23 17:19:15 (GMT)
commit0c2dd0c0a9498422645a2805a955b9a898298bc6 (patch)
treef98ad2598c161f12732d501b7ee18540a3efa727 /Lib/os.py
parentf1e0273023d870e575add13dc05ab507ed05268f (diff)
downloadcpython-0c2dd0c0a9498422645a2805a955b9a898298bc6.zip
cpython-0c2dd0c0a9498422645a2805a955b9a898298bc6.tar.gz
cpython-0c2dd0c0a9498422645a2805a955b9a898298bc6.tar.bz2
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 06616c6..87689cc 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -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: