# HG changeset patch # User Matt Harbison # Date 1615500652 18000 # Node ID 799973a44c82e428b67ed8621878c41d9400fa3d # Parent 98c816e89fac87a944514caa052ebcb5884466a1 branchmap: force Exception to bytes before logging Here was an instance where `black` mangled the formatting so that `pytype` didn't recognize the suppression directive. But it seems that the error was correct, and the code should follow other recent changes around exception conversion. File "/mnt/c/Users/Matt/hg/mercurial/branchmap.py", line 303, in fromfile: Function _bytestr.__init__ was called with the wrong arguments [wrong-arg-types] Expected: (self, ints: Iterable[int]) Actually passed: (self, ints: Exception) The following methods aren't implemented on Exception: __iter__ Differential Revision: https://phab.mercurial-scm.org/D10170 diff -r 98c816e89fac -r 799973a44c82 mercurial/branchmap.py --- a/mercurial/branchmap.py Thu Mar 11 17:05:37 2021 -0500 +++ b/mercurial/branchmap.py Thu Mar 11 17:10:52 2021 -0500 @@ -299,9 +299,7 @@ msg % ( _branchcachedesc(repo), - pycompat.bytestr( - inst - ), # pytype: disable=wrong-arg-types + stringutil.forcebytestr(inst), ) ) bcache = None