]> granicus.if.org Git - python/commitdiff
Repair accidental NameError.
authorGeorg Brandl <georg@python.org>
Mon, 24 Jul 2006 20:11:35 +0000 (20:11 +0000)
committerGeorg Brandl <georg@python.org>
Mon, 24 Jul 2006 20:11:35 +0000 (20:11 +0000)
Lib/traceback.py

index 24b9c68b84b2f1ae401b2ab90dd08c672391296f..f634159e8158855f788cdae0b24d0efceb4e7bc7 100644 (file)
@@ -179,13 +179,14 @@ def format_exception_only(etype, value):
         return [_format_final_exc_line(stype, value)]
 
     # It was a syntax error; show exactly where the problem was found.
+    lines = []
     try:
         msg, (filename, lineno, offset, badline) = value
     except Exception:
         pass
     else:
         filename = filename or "<string>"
-        lines = [('  File "%s", line %d\n' % (filename, lineno))]
+        lines.append('  File "%s", line %d\n' % (filename, lineno))
         if badline is not None:
             lines.append('    %s\n' % badline.strip())
             if offset is not None: