# HG changeset patch # User Matt Harbison # Date 2019-12-16 02:26:21 # Node ID eff050dbb7037e323958a67f7f14effffd9d2ed8 # Parent 40bd667491a77a205010ff76f96104beaab1e61d util: rename a variable to avoid confusing pytype Fixes the following warning: line 1205, in f: No attribute 'append' on Dict[nothing, nothing] [attribute-error] In Union[Dict[nothing, nothing], list] Differential Revision: https://phab.mercurial-scm.org/D7673 diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1195,12 +1195,12 @@ def cachefunc(func): '''cache the result of function calls''' # XXX doesn't handle keywords args if func.__code__.co_argcount == 0: - cache = [] + listcache = [] def f(): - if len(cache) == 0: - cache.append(func()) - return cache[0] + if len(listcache) == 0: + listcache.append(func()) + return listcache[0] return f cache = {}