mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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():
|
||||
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue