Repair accidental NameError.
This commit is contained in:
parent
a2946a437e
commit
afb44f47d9
|
@ -179,13 +179,14 @@ def format_exception_only(etype, value):
|
||||||
return [_format_final_exc_line(stype, value)]
|
return [_format_final_exc_line(stype, value)]
|
||||||
|
|
||||||
# It was a syntax error; show exactly where the problem was found.
|
# It was a syntax error; show exactly where the problem was found.
|
||||||
|
lines = []
|
||||||
try:
|
try:
|
||||||
msg, (filename, lineno, offset, badline) = value
|
msg, (filename, lineno, offset, badline) = value
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
filename = filename or "<string>"
|
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:
|
if badline is not None:
|
||||||
lines.append(' %s\n' % badline.strip())
|
lines.append(' %s\n' % badline.strip())
|
||||||
if offset is not None:
|
if offset is not None:
|
||||||
|
|
Loading…
Reference in New Issue