From: Zachary Ware Date: Wed, 10 Aug 2016 05:35:27 +0000 (-0500) Subject: Issue #27208: Fix doctest in Doc/library/traceback.rst X-Git-Tag: v3.6.0a4~38^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c90fccdff6f5e72f1e4ff09ba1ba7697f70b0f4b;p=thirdparty%2FPython%2Fcpython.git Issue #27208: Fix doctest in Doc/library/traceback.rst Patch by Jelle Zijlstra. --- diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst index 6ec9ada530ca..3c1d9bb51dc6 100644 --- a/Doc/library/traceback.rst +++ b/Doc/library/traceback.rst @@ -361,7 +361,7 @@ exception and traceback: traceback.print_exception(exc_type, exc_value, exc_traceback, limit=2, file=sys.stdout) print("*** print_exc:") - traceback.print_exc() + traceback.print_exc(limit=2, file=sys.stdout) print("*** format_exc, first and last line:") formatted_lines = traceback.format_exc().splitlines() print(formatted_lines[0]) @@ -407,9 +407,9 @@ The output for the example would look similar to this: ' File "", line 7, in bright_side_of_death\n return tuple()[0]\n', 'IndexError: tuple index out of range\n'] *** extract_tb: - [('', 10, '', 'lumberjack()'), - ('', 4, 'lumberjack', 'bright_side_of_death()'), - ('', 7, 'bright_side_of_death', 'return tuple()[0]')] + [, line 10 in >, + , line 4 in lumberjack>, + , line 7 in bright_side_of_death>] *** format_tb: [' File "", line 10, in \n lumberjack()\n', ' File "", line 4, in lumberjack\n bright_side_of_death()\n',