mercurial/pure/mpatch.py
changeset 43077 687b865b95ad
parent 43076 2372284d9457
child 45942 89a2afe31e82
--- a/mercurial/pure/mpatch.py	Sun Oct 06 09:45:02 2019 -0400
+++ b/mercurial/pure/mpatch.py	Sun Oct 06 09:48:39 2019 -0400
@@ -97,9 +97,9 @@
         while pos < end:
             m.seek(pos)
             try:
-                p1, p2, l = struct.unpack(">lll", m.read(12))
+                p1, p2, l = struct.unpack(b">lll", m.read(12))
             except struct.error:
-                raise mpatchError("patch cannot be decoded")
+                raise mpatchError(b"patch cannot be decoded")
             _pull(new, frags, p1 - last)  # what didn't change
             _pull([], frags, p2 - p1)  # what got deleted
             new.append((l, pos + 12))  # what got added
@@ -120,7 +120,7 @@
 
     while data <= binend:
         decode = delta[bin : bin + 12]
-        start, end, length = struct.unpack(">lll", decode)
+        start, end, length = struct.unpack(b">lll", decode)
         if start > end:
             break
         bin = data + length
@@ -130,7 +130,7 @@
         outlen += length
 
     if bin != binend:
-        raise mpatchError("patch cannot be decoded")
+        raise mpatchError(b"patch cannot be decoded")
 
     outlen += orig - last
     return outlen