mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +00:00
mwh: [ Patch #103228 ] traceback.py nit.
When the exception has no message, don't insert a colon after the exception name.
This commit is contained in:
parent
4ec59c75e3
commit
3ad167ae34
1 changed files with 5 additions and 1 deletions
|
|
@ -166,7 +166,11 @@ def format_exception_only(etype, value):
|
||||||
s = s + ' '
|
s = s + ' '
|
||||||
list.append('%s^\n' % s)
|
list.append('%s^\n' % s)
|
||||||
value = msg
|
value = msg
|
||||||
list.append('%s: %s\n' % (str(stype), _some_str(value)))
|
s = _some_str(value)
|
||||||
|
if s:
|
||||||
|
list.append('%s: %s\n' % (str(stype), s))
|
||||||
|
else:
|
||||||
|
list.append('%s\n' % str(stype))
|
||||||
return list
|
return list
|
||||||
|
|
||||||
def _some_str(value):
|
def _some_str(value):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue