Mercurial > hg-stable
changeset 49732:b2666e767029
cffi: adjust the list returned by bdiff.blocks to never have a None entry
This was flagged by pytype after merging the corresponding bdiff.pyi in cext:
File ".../mercurial/cffi/bdiff.py", line 44, in blocks: bad return type [bad-return-type]
Expected: List[Tuple[int, int, int, int]]
Actually returned: List[None]
AFAICT, all callers immediately unpack the tuple into 4 variables, so a `None`
entry would simply crash if they aren't all overwritten. As long a `count` and
the link list are consistent, this shouldn't be a problem.
This placates both pytype and PyCharm (which complained about the `i` in `rl[i]`
having the wrong type with the old code).
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Tue, 08 Nov 2022 13:52:46 -0500 |
parents | b8389533ba3a |
children | 594fc56c0af7 |
files | mercurial/cffi/bdiff.py |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff