# HG changeset patch # User Matt Harbison # Date 2021-10-23 20:04:05 # Node ID ebac1873314223bba9ec4d83bb8d36afdbd8079a # Parent 0d6a099bba58a667c57e8e678cf22a433348d01e typing: add a few assertions to revlog.py to help pytype I've seen this before, but this was seen as potentially `None` with pytype 2021.10.18. Differential Revision: https://phab.mercurial-scm.org/D11718 diff --git a/mercurial/revlog.py b/mercurial/revlog.py --- a/mercurial/revlog.py +++ b/mercurial/revlog.py @@ -2581,10 +2581,15 @@ class revlog(object): self._enforceinlinesize(transaction) if self._docket is not None: # revlog-v2 always has 3 writing handles, help Pytype - assert self._writinghandles[2] is not None - self._docket.index_end = self._writinghandles[0].tell() - self._docket.data_end = self._writinghandles[1].tell() - self._docket.sidedata_end = self._writinghandles[2].tell() + wh1 = self._writinghandles[0] + wh2 = self._writinghandles[1] + wh3 = self._writinghandles[2] + assert wh1 is not None + assert wh2 is not None + assert wh3 is not None + self._docket.index_end = wh1.tell() + self._docket.data_end = wh2.tell() + self._docket.sidedata_end = wh3.tell() nodemaputil.setup_persistent_nodemap(transaction, self)