Skip to content

Commit

Permalink
Rename variable to avoid mypy type error (#23669)
Browse files Browse the repository at this point in the history
Reusing variables can cause a mypy type error (python/mypy#1174).
This previously went unnoticed because the previous and current use of `key` was `str`, but in
#23644 the previous use was retyped to `Text`
and as such caused a unicode-vs-str type error in mypy.
  • Loading branch information
stephenmcgruer committed May 19, 2020
1 parent 619f6fa commit 7b9a66f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/manifest/sourcefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7b9a66f

Please sign in to comment.