summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2010-03-13 01:30:13 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2010-03-13 01:30:13 (GMT)
commit7b7320e3b73a5c05f163fc946d4f9d8729857015 (patch)
treeb6f46e8106ea72ec8f98c4ac83be49a5ca26d0fb
parent9ebc18724b266e35cf33d7436cdbf5a15dbd92ce (diff)
downloadcpython-7b7320e3b73a5c05f163fc946d4f9d8729857015.zip
cpython-7b7320e3b73a5c05f163fc946d4f9d8729857015.tar.gz
cpython-7b7320e3b73a5c05f163fc946d4f9d8729857015.tar.bz2
Merged revisions 78896 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r78896 | ezio.melotti | 2010-03-13 03:28:34 +0200 (Sat, 13 Mar 2010) | 9 lines Merged revisions 78895 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78895 | ezio.melotti | 2010-03-13 03:21:34 +0200 (Sat, 13 Mar 2010) | 1 line #8011: use exc.tb_lineno instead of traceback.tb_lineno() and pep8ify variable names. ........ ................
-rw-r--r--Doc/library/traceback.rst18
1 files changed, 9 insertions, 9 deletions
diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst
index 1450797..32e5733 100644
--- a/Doc/library/traceback.rst
+++ b/Doc/library/traceback.rst
@@ -172,12 +172,12 @@ exception and traceback:
try:
lumberjack()
- except:
- exceptionType, exceptionValue, exceptionTraceback = sys.exc_info()
+ except IndexError:
+ exc_type, exc_value, exc_traceback = sys.exc_info()
print("*** print_tb:")
- traceback.print_tb(exceptionTraceback, limit=1, file=sys.stdout)
+ traceback.print_tb(exc_traceback, limit=1, file=sys.stdout)
print("*** print_exception:")
- traceback.print_exception(exceptionType, exceptionValue, exceptionTraceback,
+ traceback.print_exception(exc_type, exc_value, exc_traceback,
limit=2, file=sys.stdout)
print("*** print_exc:")
traceback.print_exc()
@@ -186,13 +186,13 @@ exception and traceback:
print(formatted_lines[0])
print(formatted_lines[-1])
print("*** format_exception:")
- print(repr(traceback.format_exception(exceptionType, exceptionValue,
- exceptionTraceback)))
+ print(repr(traceback.format_exception(exc_type, exc_value,
+ exc_traceback)))
print("*** extract_tb:")
- print(repr(traceback.extract_tb(exceptionTraceback)))
+ print(repr(traceback.extract_tb(exc_traceback)))
print("*** format_tb:")
- print(repr(traceback.format_tb(exceptionTraceback)))
- print("*** tb_lineno:", traceback.tb_lineno(exceptionTraceback))
+ print(repr(traceback.format_tb(exc_traceback)))
+ print("*** tb_lineno:", exc_traceback.tb_lineno)
The output for the example would look similar to this: