##// END OF EJS Templates
Switching to use ulinecache on SyntaxError traceback
Jörgen Stenarson -
Show More
@@ -560,14 +560,7 b' class ListTB(TBTools):'
560 (Colors.normalEm,
560 (Colors.normalEm,
561 Colors.filenameEm, py3compat.cast_unicode(value.filename), Colors.normalEm,
561 Colors.filenameEm, py3compat.cast_unicode(value.filename), Colors.normalEm,
562 Colors.linenoEm, value.lineno, Colors.Normal ))
562 Colors.linenoEm, value.lineno, Colors.Normal ))
563 if value.filename[:1] != "<":
563 textline = ulinecache.getline(value.filename, value.lineno)
564 # The value.text on the exception seems to be encoded using error="replace"
565 # Read source file directly
566 textline = read_py_file(value.filename, skip_encoding_cookie=False).split("\n")[value.lineno - 1]
567 else:
568 #It seems code entered at the prompt always results in source
569 #encoded in utf-8 format
570 textline = py3compat.cast_unicode(value.text, encoding="utf-8")
571
564
572 if textline is not None:
565 if textline is not None:
573 i = 0
566 i = 0
General Comments 0
You need to be logged in to leave comments. Login now