statprof: add a couple of asserts to avoid storing unicodes
authorAugie Fackler <augie@google.com>
Thu, 01 Nov 2018 17:11:31 -0400
changeset 40484 93501a5fd62b
parent 40483 4e6ffcb5b9fc
child 40485 8664fdc1cfb3
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
mercurial/statprof.py
--- a/mercurial/statprof.py	Thu Nov 01 17:09:55 2018 -0400
+++ b/mercurial/statprof.py	Thu Nov 01 17:11:31 2018 -0400
@@ -206,8 +206,10 @@
     __slots__ = (u'path', u'lineno', u'function', u'source')
 
     def __init__(self, path, lineno, function):
+        assert isinstance(path, bytes)
         self.path = path
         self.lineno = lineno
+        assert isinstance(function, bytes)
         self.function = function
         self.source = None