Mercurial > public > mercurial-scm > hg
comparison mercurial/statprof.py @ 30568:bb35fe8621f5
py3: use unicodes in __slots__
__slots__ in Python 3 accepts only unicodes and there is no harm using
unicodes in __slots__. So just adding u'' is fine. Previous occurences of this
problem are treated the same way.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 30 Nov 2016 23:38:50 +0530 |
parents | 1e5346313963 |
children | c6ce11f2ee50 |
comparison
equal
deleted
inserted
replaced
30567:73ce055b169a | 30568:bb35fe8621f5 |
---|---|
175 | 175 |
176 | 176 |
177 class CodeSite(object): | 177 class CodeSite(object): |
178 cache = {} | 178 cache = {} |
179 | 179 |
180 __slots__ = ('path', 'lineno', 'function', 'source') | 180 __slots__ = (u'path', u'lineno', u'function', u'source') |
181 | 181 |
182 def __init__(self, path, lineno, function): | 182 def __init__(self, path, lineno, function): |
183 self.path = path | 183 self.path = path |
184 self.lineno = lineno | 184 self.lineno = lineno |
185 self.function = function | 185 self.function = function |
230 | 230 |
231 def filename(self): | 231 def filename(self): |
232 return os.path.basename(self.path) | 232 return os.path.basename(self.path) |
233 | 233 |
234 class Sample(object): | 234 class Sample(object): |
235 __slots__ = ('stack', 'time') | 235 __slots__ = (u'stack', u'time') |
236 | 236 |
237 def __init__(self, stack, time): | 237 def __init__(self, stack, time): |
238 self.stack = stack | 238 self.stack = stack |
239 self.time = time | 239 self.time = time |
240 | 240 |