mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Use supported raise from
This commit is contained in:
1 parent
216f69e635
commit
f5653cbc68
1 file changed
+2
-4
@@ -33,8 +33,7 @@ class _Environ(MutableMapping):
|
||||
value = self._data[self.encodekey(key)]
|
||||
except KeyError:
|
||||
# raise KeyError with the original key value
|
||||
# raise KeyError(key) from None
|
||||
raise KeyError(key)
|
||||
raise KeyError(key) from None
|
||||
|
||||
return self.decodevalue(value)
|
||||
|
||||
@@ -51,8 +50,7 @@ class _Environ(MutableMapping):
|
||||
del self._data[encodedkey]
|
||||
except KeyError:
|
||||
# raise KeyError with the original key value
|
||||
# raise KeyError(key) from None
|
||||
raise KeyError(key)
|
||||
raise KeyError(key) from None
|
||||
|
||||
def __iter__(self):
|
||||
# list() from dict object is an atomic operation
|
||||
|
||||
Reference in new issue
Block a user