##// END OF EJS Templates
Whitelist file extensions that are safe to tokenise.
Thomas Kluyver -
Show More
@@ -825,13 +825,16 b' class VerboseTB(TBTools):'
825 call = tpl_call_fail % func
825 call = tpl_call_fail % func
826
826
827 # Don't attempt to tokenize binary files.
827 # Don't attempt to tokenize binary files.
828 if file.endswith(('.so', '.pyd', '.dll')):
828 if not file.endswith(('.py', '.pyw')):
829 frames.append('%s %s\n' % (link,call))
830 continue
831
832 def linereader(file=file, lnum=[lnum], getline=linecache.getline):
833 if file.endswith(('.pyc','.pyo')):
829 if file.endswith(('.pyc','.pyo')):
830 # Look up the corresponding source file.
834 file = pyfile.source_from_cache(file)
831 file = pyfile.source_from_cache(file)
832 else:
833 # .so, .pyd, etc.
834 frames.append('%s %s\n' % (link,call))
835 continue
836
837 def linereader(file=file, lnum=[lnum], getline=linecache.getline):
835 line = getline(file, lnum[0])
838 line = getline(file, lnum[0])
836 lnum[0] += 1
839 lnum[0] += 1
837 return line
840 return line
General Comments 0
You need to be logged in to leave comments. Login now