diff options
Diffstat (limited to 'Lib/os.py')
-rw-r--r-- | Lib/os.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -697,7 +697,9 @@ class _Environ(MutableMapping): raise KeyError(key) from None def __iter__(self): - for key in self._data: + # list() from dict object is an atomic operation + keys = list(self._data) + for key in keys: yield self.decodekey(key) def __len__(self): |