comparison mercurial/branchmap.py @ 46685:799973a44c82 stable

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
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 11 Mar 2021 17:10:52 -0500
parents c4b792fa109e
children e2f7b2695ba1
comparison
equal deleted inserted replaced
46684:98c816e89fac 46685:799973a44c82
297 msg = b'invalid %s: %s\n' 297 msg = b'invalid %s: %s\n'
298 repo.ui.debug( 298 repo.ui.debug(
299 msg 299 msg
300 % ( 300 % (
301 _branchcachedesc(repo), 301 _branchcachedesc(repo),
302 pycompat.bytestr( 302 stringutil.forcebytestr(inst),
303 inst
304 ), # pytype: disable=wrong-arg-types
305 ) 303 )
306 ) 304 )
307 bcache = None 305 bcache = None
308 306
309 finally: 307 finally: