comparison mercurial/error.py @ 51288:8b2ea2246a5f

pytype: convert type comment for inline variable too Same logic as for the previous changeset, but for "type comment" annotating variables, not function/method. As for the previous changeset, we had to adjust for of the types to actually match what was happening.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 20 Dec 2023 11:23:09 +0100
parents f15cb5111a1e
children f4a0806081f2
comparison
equal deleted inserted replaced
51287:f15cb5111a1e 51288:8b2ea2246a5f
55 This should come first in the inheritance list to consume a hint and 55 This should come first in the inheritance list to consume a hint and
56 pass remaining arguments to the exception class. 56 pass remaining arguments to the exception class.
57 """ 57 """
58 58
59 def __init__(self, *args, **kw): 59 def __init__(self, *args, **kw):
60 self.hint = kw.pop('hint', None) # type: Optional[bytes] 60 self.hint: Optional[bytes] = kw.pop('hint', None)
61 super(Hint, self).__init__(*args, **kw) 61 super(Hint, self).__init__(*args, **kw)
62 62
63 63
64 class Error(Hint, Exception): 64 class Error(Hint, Exception):
65 """Base class for Mercurial errors.""" 65 """Base class for Mercurial errors."""