Show More
@@ -248,7 +248,7 b' def fix_frame_records_filenames(records):' | |||||
248 | # Look inside the frame's globals dictionary for __file__, |
|
248 | # Look inside the frame's globals dictionary for __file__, | |
249 | # which should be better. However, keep Cython filenames since |
|
249 | # which should be better. However, keep Cython filenames since | |
250 | # we prefer the source filenames over the compiled .so file. |
|
250 | # we prefer the source filenames over the compiled .so file. | |
251 | filename = py3compat.cast_unicode(filename, "utf-8") |
|
251 | filename = py3compat.cast_unicode_py2(filename, "utf-8") | |
252 | if not filename.endswith(('.pyx', '.pxd', '.pxi')): |
|
252 | if not filename.endswith(('.pyx', '.pxd', '.pxi')): | |
253 | better_fn = frame.f_globals.get('__file__', None) |
|
253 | better_fn = frame.f_globals.get('__file__', None) | |
254 | if isinstance(better_fn, str): |
|
254 | if isinstance(better_fn, str): | |
@@ -540,9 +540,9 b' class ListTB(TBTools):' | |||||
540 | list = [] |
|
540 | list = [] | |
541 | for filename, lineno, name, line in extracted_list[:-1]: |
|
541 | for filename, lineno, name, line in extracted_list[:-1]: | |
542 | item = ' File %s"%s"%s, line %s%d%s, in %s%s%s\n' % \ |
|
542 | item = ' File %s"%s"%s, line %s%d%s, in %s%s%s\n' % \ | |
543 | (Colors.filename, py3compat.cast_unicode(filename, "utf-8"), Colors.Normal, |
|
543 | (Colors.filename, py3compat.cast_unicode_py2(filename, "utf-8"), Colors.Normal, | |
544 | Colors.lineno, lineno, Colors.Normal, |
|
544 | Colors.lineno, lineno, Colors.Normal, | |
545 | Colors.name, py3compat.cast_unicode(name, "utf-8"), Colors.Normal) |
|
545 | Colors.name, py3compat.cast_unicode_py2(name, "utf-8"), Colors.Normal) | |
546 | if line: |
|
546 | if line: | |
547 | item += ' %s\n' % line.strip() |
|
547 | item += ' %s\n' % line.strip() | |
548 | list.append(item) |
|
548 | list.append(item) | |
@@ -550,9 +550,9 b' class ListTB(TBTools):' | |||||
550 | filename, lineno, name, line = extracted_list[-1] |
|
550 | filename, lineno, name, line = extracted_list[-1] | |
551 | item = '%s File %s"%s"%s, line %s%d%s, in %s%s%s%s\n' % \ |
|
551 | item = '%s File %s"%s"%s, line %s%d%s, in %s%s%s%s\n' % \ | |
552 | (Colors.normalEm, |
|
552 | (Colors.normalEm, | |
553 | Colors.filenameEm, py3compat.cast_unicode(filename, "utf-8"), Colors.normalEm, |
|
553 | Colors.filenameEm, py3compat.cast_unicode_py2(filename, "utf-8"), Colors.normalEm, | |
554 | Colors.linenoEm, lineno, Colors.normalEm, |
|
554 | Colors.linenoEm, lineno, Colors.normalEm, | |
555 | Colors.nameEm, py3compat.cast_unicode(name, "utf-8"), Colors.normalEm, |
|
555 | Colors.nameEm, py3compat.cast_unicode_py2(name, "utf-8"), Colors.normalEm, | |
556 | Colors.Normal) |
|
556 | Colors.Normal) | |
557 | if line: |
|
557 | if line: | |
558 | item += '%s %s%s\n' % (Colors.line, line.strip(), |
|
558 | item += '%s %s%s\n' % (Colors.line, line.strip(), |
General Comments 0
You need to be logged in to leave comments.
Login now