##// END OF EJS Templates
Avoid calling getline() if lineno is None.
Jez Ng -
Show More
@@ -556,12 +556,16 b' class ListTB(TBTools):'
556 have_filedata = True
556 have_filedata = True
557 #print 'filename is',filename # dbg
557 #print 'filename is',filename # dbg
558 if not value.filename: value.filename = "<string>"
558 if not value.filename: value.filename = "<string>"
559 if not value.lineno: value.lineno = "unknown"
559 if value.lineno:
560 lineno = value.lineno
561 textline = ulinecache.getline(value.filename, value.lineno)
562 else:
563 lineno = 'unknown'
564 textline = ''
560 list.append('%s File %s"%s"%s, line %s%s%s\n' % \
565 list.append('%s File %s"%s"%s, line %s%s%s\n' % \
561 (Colors.normalEm,
566 (Colors.normalEm,
562 Colors.filenameEm, py3compat.cast_unicode(value.filename), Colors.normalEm,
567 Colors.filenameEm, py3compat.cast_unicode(value.filename), Colors.normalEm,
563 Colors.linenoEm, value.lineno, Colors.Normal ))
568 Colors.linenoEm, lineno, Colors.Normal ))
564 textline = ulinecache.getline(value.filename, value.lineno)
565 if textline == '':
569 if textline == '':
566 textline = py3compat.cast_unicode(value.text, "utf-8")
570 textline = py3compat.cast_unicode(value.text, "utf-8")
567
571
General Comments 0
You need to be logged in to leave comments. Login now