mirror of https://github.com/python/cpython
#5856: fix typo s in traceback example.
This commit is contained in:
parent
e34d6aa86f
commit
e1b79ce17e
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
:mod:`traceback` --- Print or retrieve a stack traceback
|
:mod:`traceback` --- Print or retrieve a stack traceback
|
||||||
========================================================
|
========================================================
|
||||||
|
|
||||||
|
@ -275,10 +274,10 @@ The following example shows the different ways to print and format the stack::
|
||||||
This last example demonstrates the final few formatting functions::
|
This last example demonstrates the final few formatting functions::
|
||||||
|
|
||||||
>>> import traceback
|
>>> import traceback
|
||||||
>>> format_list([('spam.py', 3, '<module>', 'spam.eggs()'),
|
>>> traceback.format_list([('spam.py', 3, '<module>', 'spam.eggs()'),
|
||||||
... ('eggs.py', 42, 'eggs', 'return "bacon"')])
|
... ('eggs.py', 42, 'eggs', 'return "bacon"')])
|
||||||
[' File "spam.py", line 3, in <module>\n spam.eggs()\n',
|
[' File "spam.py", line 3, in <module>\n spam.eggs()\n',
|
||||||
' File "eggs.py", line 42, in eggs\n return "bacon"\n']
|
' File "eggs.py", line 42, in eggs\n return "bacon"\n']
|
||||||
>>> theError = IndexError('tuple indx out of range')
|
>>> an_error = IndexError('tuple index out of range')
|
||||||
>>> traceback.format_exception_only(type(theError), theError)
|
>>> traceback.format_exception_only(type(an_error), an_error)
|
||||||
['IndexError: tuple index out of range\n']
|
['IndexError: tuple index out of range\n']
|
||||||
|
|
Loading…
Reference in New Issue