diff --git a/IPython/core/ultratb.py b/IPython/core/ultratb.py index 61f5e6a..9e45e04 100644 --- a/IPython/core/ultratb.py +++ b/IPython/core/ultratb.py @@ -823,6 +823,11 @@ class VerboseTB(TBTools): # will illustrate the error, if this exception catch is # disabled. call = tpl_call_fail % func + + # Don't attempt to tokenize binary files. + if file.endswith(('.so', '.pyd', '.dll')): + frames.append('%s %s\n' % (link,call)) + continue def linereader(file=file, lnum=[lnum], getline=linecache.getline): if file.endswith(('.pyc','.pyo')):