diff Lib/cgitb.py @ 35155:f5473a762b50 2.4

Backport: Prevent creating a HTML link to file://?/
author Georg Brandl <georg@python.org>
date Sun, 26 Jun 2005 21:59:34 +0000
parents c3a096bfbd6b
children 26349a64ef70
line wrap: on
line diff
--- a/Lib/cgitb.py	Sun Jun 26 21:50:34 2005 +0000
+++ b/Lib/cgitb.py	Sun Jun 26 21:59:34 2005 +0000
@@ -112,8 +112,11 @@
     frames = []
     records = inspect.getinnerframes(etb, context)
     for frame, file, lnum, func, lines, index in records:
-        file = file and os.path.abspath(file) or '?'
-        link = '<a href="file://%s">%s</a>' % (file, pydoc.html.escape(file))
+        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 != '?':