changeset 46692:39f23d20ea47 stable

merge: force an exception message to bytes before printing as a warning Caught by pytype: File "/mnt/c/Users/Matt/hg/mercurial/merge.py", line 1346, in batchremove: Function _bytestr.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, ints: Iterable[int]) Actually passed: (self, ints: str) Differential Revision: https://phab.mercurial-scm.org/D10177
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 11 Mar 2021 18:33:39 -0500
parents 1099541b6462
children 5f86765c9707
files mercurial/merge.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/merge.py	Thu Mar 11 18:09:55 2021 -0500
+++ b/mercurial/merge.py	Thu Mar 11 18:33:39 2021 -0500
@@ -20,6 +20,7 @@
     nullrev,
 )
 from .thirdparty import attr
+from .utils import stringutil
 from . import (
     copies,
     encoding,
@@ -1341,7 +1342,7 @@
         except OSError as inst:
             repo.ui.warn(
                 _(b"update failed to remove %s: %s!\n")
-                % (f, pycompat.bytestr(inst.strerror))
+                % (f, stringutil.forcebytestr(inst.strerror))
             )
         if i == 100:
             yield i, f