changeset 43880:eff050dbb703

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
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 15 Dec 2019 21:26:21 -0500
parents 40bd667491a7
children b5655f337bd7
files mercurial/util.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Sun Dec 15 21:22:27 2019 -0500
+++ b/mercurial/util.py	Sun Dec 15 21:26:21 2019 -0500
@@ -1195,12 +1195,12 @@
     '''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 = {}