Prevent creating a HTML link to file://?/

This commit is contained in:
Georg Brandl 2005-06-26 21:57:55 +00:00
parent fbff1bcd69
commit 07c81d9074
1 changed files with 5 additions and 2 deletions

View File

@ -112,8 +112,11 @@ function calls leading up to the error, in the order they occurred.</p>'''
frames = []
records = inspect.getinnerframes(etb, context)
for frame, file, lnum, func, lines, index in records:
file = file and os.path.abspath(file) or '?'
if file:
file = os.path.abspath(file)
link = '<a href="file://%s">%s</a>' % (file, pydoc.html.escape(file))
else:
file = link = '?'
args, varargs, varkw, locals = inspect.getargvalues(frame)
call = ''
if func != '?':