From: Georg Brandl Date: Mon, 27 Apr 2009 15:09:25 +0000 (+0000) Subject: #5856: fix typo s in traceback example. X-Git-Tag: v2.7a1~1362 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1b79ce17e5e722a71b56234e66952fe7ccb8945;p=thirdparty%2FPython%2Fcpython.git #5856: fix typo s in traceback example. --- diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst index 126003785775..31a4583c14f1 100644 --- a/Doc/library/traceback.rst +++ b/Doc/library/traceback.rst @@ -1,4 +1,3 @@ - :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:: >>> import traceback - >>> format_list([('spam.py', 3, '', 'spam.eggs()'), - ... ('eggs.py', 42, 'eggs', 'return "bacon"')]) + >>> traceback.format_list([('spam.py', 3, '', 'spam.eggs()'), + ... ('eggs.py', 42, 'eggs', 'return "bacon"')]) [' File "spam.py", line 3, in \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']