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
7266496b
Commit
7266496b
authored
Feb 25, 1998
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweak the tb_lineno() function to be compatible with JPython, which
has no line number table etc.
parent
50b3eb6a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
Lib/traceback.py
Lib/traceback.py
+8
-4
No files found.
Lib/traceback.py
View file @
7266496b
...
...
@@ -188,10 +188,14 @@ def extract_stack(f=None, limit = None):
# in compile.c.
def
tb_lineno
(
tb
):
c
=
tb
.
tb_frame
.
f_code
tab
=
c
.
co_lnotab
line
=
c
.
co_firstlineno
stopat
=
tb
.
tb_lasti
f
=
tb
.
tb_frame
try
:
c
=
f
.
f_code
tab
=
c
.
co_lnotab
line
=
c
.
co_firstlineno
stopat
=
tb
.
tb_lasti
except
AttributeError
:
return
f
.
f_lineno
addr
=
0
for
i
in
range
(
0
,
len
(
tab
),
2
):
addr
=
addr
+
ord
(
tab
[
i
])
...
...
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