From dd62aeedfd5fd064dfbdfc6112eefd98d78e84fe Mon Sep 17 00:00:00 2001 From: Stephen McGruer Date: Tue, 26 May 2020 11:21:40 +0000 Subject: [PATCH] Bug 1638892 [wpt PR 23669] - Rename variable to avoid mypy type error, a=testonly Automatic update from web-platform-tests 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. -- wpt-commits: 7b9a66f8a9cf68bbe220473f9eff0e652998c072 wpt-pr: 23669 --- testing/web-platform/tests/tools/manifest/sourcefile.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testing/web-platform/tests/tools/manifest/sourcefile.py b/testing/web-platform/tests/tools/manifest/sourcefile.py index 11779532c1e55..b324bf22dd382 100644 --- a/testing/web-platform/tests/tools/manifest/sourcefile.py +++ b/testing/web-platform/tests/tools/manifest/sourcefile.py @@ -989,9 +989,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