Skip to content

Commit

Permalink
Fix for displaying variables in verbose traceback.
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed May 9, 2012
1 parent cb19d0d commit 9f6601d
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions IPython/core/ultratb.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -786,13 +786,19 @@ def nullrepr(value, repr=text_repr): return ''
abspath = os.path.abspath abspath = os.path.abspath
for frame, file, lnum, func, lines, index in records: for frame, file, lnum, func, lines, index in records:
#print '*** record:',file,lnum,func,lines,index # dbg #print '*** record:',file,lnum,func,lines,index # dbg
try:
file = file and abspath(file) or '?' if not file:
except OSError: file = '?'
# if file is '<console>' or something not in the filesystem, elif not(file.startswith("<") and file.endswith(">")):
# the abspath call will throw an OSError. Just ignore it and # Guess that filenames like <string> aren't real filenames, so
# keep the original file string. # don't call abspath on them.
pass try:
file = abspath(file)
except OSError:
# Not sure if this can still happen: abspath now works with
# file names like <string>
pass

link = tpl_link % file link = tpl_link % file
args, varargs, varkw, locals = inspect.getargvalues(frame) args, varargs, varkw, locals = inspect.getargvalues(frame)


Expand Down

0 comments on commit 9f6601d

Please sign in to comment.