Fix the KeyError in multi_worker_test_base.py caused by __iter__ returning (key, value) which gets interpreted as the key (and hence no value is found).

PiperOrigin-RevId: 236163036
This commit is contained in:
Rick Chao 2019-02-28 11:35:32 -08:00 committed by TensorFlower Gardener
parent b9f81dfea1
commit 5139b72eff

View File

@ -347,9 +347,9 @@ class MockOsEnv(collections.Mapping):
def __iter__(self):
if not hasattr(self._thread_local, 'dict'):
self._thread_local.dict = dict()
for x in self._thread_local.dict.items():
for x in self._thread_local.dict:
yield x
for x in self._dict.items():
for x in self._dict:
yield x
def __len__(self):