manifest: type and fix unhexlify
authorPierre-Yves David <pierre-yves.david@octobus.net>
Sun, 04 Aug 2024 10:47:29 +0200
changeset 51764 2f88df88f5b9
parent 51763 81be242a1b5c
child 51765 50b3ff0ec297
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.
mercurial/manifest.py
--- 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