diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -1480,6 +1480,8 @@ if default is _notset: raise return default + + assert node is not None # help pytype value = node.value self.totalcost -= node.cost node.markempty() @@ -1567,6 +1569,8 @@ while n.key is _notset: n = n.prev + assert n is not None # help pytype + key, value = n.key, n.value # And remove it from the cache and mark it as empty.