From 7b9a66f8a9cf68bbe220473f9eff0e652998c072 Mon Sep 17 00:00:00 2001 From: Stephen McGruer Date: Mon, 18 May 2020 22:09:26 -0400 Subject: [PATCH] Rename variable to avoid mypy type error (#23669) Reusing variables can cause a mypy type error (https://github.com/python/mypy/issues/1174). This previously went unnoticed because the previous and current use of `key` was `str`, but in https://github.com/web-platform-tests/wpt/pull/23644 the previous use was retyped to `Text` and as such caused a unicode-vs-str type error in mypy. --- tools/manifest/sourcefile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/manifest/sourcefile.py b/tools/manifest/sourcefile.py index 5d8b73481e6e19..c374ba050434e8 100644 --- a/tools/manifest/sourcefile.py +++ b/tools/manifest/sourcefile.py @@ -992,9 +992,9 @@ def manifest_items(self): if drop_cached and "__cached_properties__" in self.__dict__: cached_properties = self.__dict__["__cached_properties__"] - for key in cached_properties: - if str(key) in self.__dict__: - del self.__dict__[str(key)] + for prop in cached_properties: + if prop in self.__dict__: + del self.__dict__[prop] del self.__dict__["__cached_properties__"] return rv