summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-07-24 20:11:35 (GMT)
committerGeorg Brandl <georg@python.org>2006-07-24 20:11:35 (GMT)
commitafb44f47d9a90ce85ddfb23f91bedb9e1064b035 (patch)
tree39f8ea6bafc36ce2868bf272421f45ff9adf949c
parenta2946a437ee7886e6192b9e02725b8a04cdc80ae (diff)
downloadcpython-afb44f47d9a90ce85ddfb23f91bedb9e1064b035.zip
cpython-afb44f47d9a90ce85ddfb23f91bedb9e1064b035.tar.gz
cpython-afb44f47d9a90ce85ddfb23f91bedb9e1064b035.tar.bz2
Repair accidental NameError.
-rw-r--r--Lib/traceback.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py
index 24b9c68..f634159 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -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: