##// END OF EJS Templates
profile: prevent a crash when line number is unknown...
marmoute -
r50473:aab3d4c0 stable
parent child Browse files
Show More
@@ -236,8 +236,8 b' class CodeSite:'
236 236
237 237 def getsource(self, length):
238 238 if self.source is None:
239 lineno = self.lineno - 1
240 239 try:
240 lineno = self.lineno - 1 # lineno can be None
241 241 with open(self.path, b'rb') as fp:
242 242 for i, line in enumerate(fp):
243 243 if i == lineno:
@@ -773,7 +773,7 b' def display_hotpath(data, fp, limit=0.05'
773 773 codestring = codepattern % (
774 774 prefix,
775 775 b'line'.rjust(spacing_len),
776 site.lineno,
776 site.lineno if site.lineno is not None else -1,
777 777 b''.ljust(max(0, 4 - len(str(site.lineno)))),
778 778 site.getsource(30),
779 779 )
General Comments 0
You need to be logged in to leave comments. Login now