Do not print caret when offset is None.

This commit is contained in:
Jeremy Hylton 2001-03-21 20:29:18 +00:00
parent 6783070ebf
commit ed9d0ba482

View file

@ -175,13 +175,14 @@ def format_exception_only(etype, value):
while i < len(line) and line[i].isspace():
i = i+1
list.append(' %s\n' % line.strip())
s = ' '
for c in line[i:offset-1]:
if c.isspace():
s = s + c
else:
s = s + ' '
list.append('%s^\n' % s)
if offset is not None:
s = ' '
for c in line[i:offset-1]:
if c.isspace():
s = s + c
else:
s = s + ' '
list.append('%s^\n' % s)
value = msg
s = _some_str(value)
if s: