From c68da893d195f32d937f39f07a90a250495806f2 2012-01-29 19:04:30 From: Thomas Kluyver Date: 2012-01-29 19:04:30 Subject: [PATCH] Switch back to blacklisting binary files before tokenising. --- diff --git a/IPython/core/ultratb.py b/IPython/core/ultratb.py index e4d4878..61ca205 100644 --- a/IPython/core/ultratb.py +++ b/IPython/core/ultratb.py @@ -825,14 +825,12 @@ class VerboseTB(TBTools): call = tpl_call_fail % func # Don't attempt to tokenize binary files. - if not file.endswith(('.py', '.pyw')): - if file.endswith(('.pyc','.pyo')): - # Look up the corresponding source file. - file = pyfile.source_from_cache(file) - else: - # .so, .pyd, etc. - frames.append('%s %s\n' % (link,call)) - continue + if file.endswith(('.so', '.pyd', '.dll')): + frames.append('%s %s\n' % (link,call)) + continue + elif file.endswith(('.pyc','.pyo')): + # Look up the corresponding source file. + file = pyfile.source_from_cache(file) def linereader(file=file, lnum=[lnum], getline=linecache.getline): line = getline(file, lnum[0])