Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
93dd9b80
Commit
93dd9b80
authored
Mar 13, 2010
by
Ezio Melotti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#8011: use exc.tb_lineno instead of traceback.tb_lineno() and pep8ify variable names.
parent
c4785a75
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
Doc/library/traceback.rst
Doc/library/traceback.rst
+9
-9
No files found.
Doc/library/traceback.rst
View file @
93dd9b80
...
...
@@ -175,12 +175,12 @@ exception and traceback::
try:
lumberjack()
except:
exc
eptionType, exceptionValue, exceptionT
raceback = sys.exc_info()
except
IndexError
:
exc
_type, exc_value, exc_t
raceback = sys.exc_info()
print "*** print_tb:"
traceback.print_tb(exc
eptionT
raceback, limit=1, file=sys.stdout)
traceback.print_tb(exc
_t
raceback, limit=1, file=sys.stdout)
print "*** print_exception:"
traceback.print_exception(exc
eptionType, exceptionValue, exceptionT
raceback,
traceback.print_exception(exc
_type, exc_value, exc_t
raceback,
limit=2, file=sys.stdout)
print "*** print_exc:"
traceback.print_exc()
...
...
@@ -189,13 +189,13 @@ exception and traceback::
print formatted_lines[0]
print formatted_lines[-1]
print "*** format_exception:"
print repr(traceback.format_exception(exc
eptionType, exceptionV
alue,
exc
eptionT
raceback))
print repr(traceback.format_exception(exc
_type, exc_v
alue,
exc
_t
raceback))
print "*** extract_tb:"
print repr(traceback.extract_tb(exc
eptionT
raceback))
print repr(traceback.extract_tb(exc
_t
raceback))
print "*** format_tb:"
print repr(traceback.format_tb(exc
eptionT
raceback))
print "*** tb_lineno:",
traceback.tb_lineno(exceptionTraceback)
print repr(traceback.format_tb(exc
_t
raceback))
print "*** tb_lineno:",
exc_traceback.tb_lineno
The output for the example would look similar to this::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment