comparison mercurial/statprof.py @ 40484:93501a5fd62b

statprof: add a couple of asserts to avoid storing unicodes I don't feel strongly about this change, so it'd be fine to drop it during review, but it was _extremely_ helpful in drafting the next change. Differential Revision: https://phab.mercurial-scm.org/D5209
author Augie Fackler <augie@google.com>
date Thu, 01 Nov 2018 17:11:31 -0400
parents cc4586749c8c
children 8664fdc1cfb3
comparison
equal deleted inserted replaced
40483:4e6ffcb5b9fc 40484:93501a5fd62b
204 cache = {} 204 cache = {}
205 205
206 __slots__ = (u'path', u'lineno', u'function', u'source') 206 __slots__ = (u'path', u'lineno', u'function', u'source')
207 207
208 def __init__(self, path, lineno, function): 208 def __init__(self, path, lineno, function):
209 assert isinstance(path, bytes)
209 self.path = path 210 self.path = path
210 self.lineno = lineno 211 self.lineno = lineno
212 assert isinstance(function, bytes)
211 self.function = function 213 self.function = function
212 self.source = None 214 self.source = None
213 215
214 def __eq__(self, other): 216 def __eq__(self, other):
215 try: 217 try: