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
f170d7fe
Commit
f170d7fe
authored
Mar 23, 2001
by
Ka-Ping Yee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't have trace() skip the top frame; return them all.
parent
6526bf86
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
Lib/inspect.py
Lib/inspect.py
+0
-1
Lib/test/test_inspect.py
Lib/test/test_inspect.py
+7
-5
No files found.
Lib/inspect.py
View file @
f170d7fe
...
...
@@ -620,7 +620,6 @@ def getinnerframes(tb, context=1):
Each
record
contains
a
frame
object
,
filename
,
line
number
,
function
name
,
a
list
of
lines
of
context
,
and
index
within
the
context
.
"""
tb = tb.tb_next
framelist = []
while tb:
framelist.append((tb.tb_frame,) + getframeinfo(tb, context))
...
...
Lib/test/test_inspect.py
View file @
f170d7fe
...
...
@@ -169,11 +169,14 @@ git.abuse(7, 8, 9)
istest
(
inspect
.
istraceback
,
'git.ex[2]'
)
istest
(
inspect
.
isframe
,
'mod.fr'
)
test
(
len
(
git
.
tr
)
==
2
,
'trace() length'
)
test
(
git
.
tr
[
0
][
1
:]
==
(
TESTFN
,
9
,
'spam'
,
[
' eggs(b + d, c + f)
\
n
'
],
0
),
'trace() row 1'
)
test
(
git
.
tr
[
1
][
1
:]
==
(
TESTFN
,
18
,
'eggs'
,
[
' q = y / 0
\
n
'
],
0
),
test
(
len
(
git
.
tr
)
==
3
,
'trace() length'
)
test
(
git
.
tr
[
0
][
1
:]
==
(
TESTFN
,
46
,
'argue'
,
[
' self.tr = inspect.trace()
\
n
'
],
0
),
'trace() row 2'
)
test
(
git
.
tr
[
1
][
1
:]
==
(
TESTFN
,
9
,
'spam'
,
[
' eggs(b + d, c + f)
\
n
'
],
0
),
'trace() row 2'
)
test
(
git
.
tr
[
2
][
1
:]
==
(
TESTFN
,
18
,
'eggs'
,
[
' q = y / 0
\
n
'
],
0
),
'trace() row 3'
)
test
(
len
(
mod
.
st
)
>=
5
,
'stack() length'
)
test
(
mod
.
st
[
0
][
1
:]
==
...
...
@@ -188,7 +191,6 @@ test(mod.st[2][1:] ==
test
(
mod
.
st
[
3
][
1
:]
==
(
TESTFN
,
39
,
'abuse'
,
[
' self.argue(a, b, c)
\
n
'
],
0
),
'stack() row 4'
)
# row 4 is in test_inspect.py
args
,
varargs
,
varkw
,
locals
=
inspect
.
getargvalues
(
mod
.
fr
)
test
(
args
==
[
'x'
,
'y'
],
'mod.fr args'
)
...
...
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