mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Do not print caret when offset is None.
This commit is contained in:
parent
6783070ebf
commit
ed9d0ba482
1 changed files with 8 additions and 7 deletions
|
@ -175,13 +175,14 @@ def format_exception_only(etype, value):
|
||||||
while i < len(line) and line[i].isspace():
|
while i < len(line) and line[i].isspace():
|
||||||
i = i+1
|
i = i+1
|
||||||
list.append(' %s\n' % line.strip())
|
list.append(' %s\n' % line.strip())
|
||||||
s = ' '
|
if offset is not None:
|
||||||
for c in line[i:offset-1]:
|
s = ' '
|
||||||
if c.isspace():
|
for c in line[i:offset-1]:
|
||||||
s = s + c
|
if c.isspace():
|
||||||
else:
|
s = s + c
|
||||||
s = s + ' '
|
else:
|
||||||
list.append('%s^\n' % s)
|
s = s + ' '
|
||||||
|
list.append('%s^\n' % s)
|
||||||
value = msg
|
value = msg
|
||||||
s = _some_str(value)
|
s = _some_str(value)
|
||||||
if s:
|
if s:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue