mirror of https://github.com/python/cpython
Merged revisions 72007 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72007 | georg.brandl | 2009-04-27 17:09:25 +0200 (Mo, 27 Apr 2009) | 1 line #5856: fix typo s in traceback example. ........
This commit is contained in:
parent
e720c0aa74
commit
0142d4a3df
|
@ -269,10 +269,10 @@ The following example shows the different ways to print and format the stack::
|
|||
This last example demonstrates the final few formatting functions::
|
||||
|
||||
>>> 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"')])
|
||||
[' File "spam.py", line 3, in <module>\n spam.eggs()\n',
|
||||
' File "eggs.py", line 42, in eggs\n return "bacon"\n']
|
||||
>>> theError = IndexError('tuple indx out of range')
|
||||
>>> traceback.format_exception_only(type(theError), theError)
|
||||
>>> an_error = IndexError('tuple index out of range')
|
||||
>>> traceback.format_exception_only(type(an_error), an_error)
|
||||
['IndexError: tuple index out of range\n']
|
||||
|
|
Loading…
Reference in New Issue