changeset 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 4e6ffcb5b9fc
children 8664fdc1cfb3
files mercurial/statprof.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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