changeset 51764:2f88df88f5b9

manifest: type and fix unhexlify Some part of that function seems to date back from Python 2. It raise question about whether this function is useful or not, but let us just fix it for now. This was caught by pytype.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 04 Aug 2024 10:47:29 +0200
parents 81be242a1b5c
children 50b3ff0ec297
files mercurial/manifest.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/manifest.py	Sun Aug 04 10:45:31 2024 +0200
+++ b/mercurial/manifest.py	Sun Aug 04 10:47:29 2024 +0200
@@ -143,10 +143,10 @@
     __next__ = next
 
 
-def unhexlify(data, extra, pos, length):
+def unhexlify(data: bytes, extra: int, pos, length: int):
     s = bin(data[pos : pos + length])
     if extra:
-        s += chr(extra & 0xFF)
+        s += bytes([extra & 0xFF])
     return s