Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_is_hidden: handle non-dict f_locals #420

Merged
merged 3 commits into from
Sep 17, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! fixup! _is_hidden: handle non-dict f_locals
  • Loading branch information
blueyed committed Sep 16, 2020
commit ccc5f877e7963ee2a16debee444a3def404456ac
9 changes: 6 additions & 3 deletions testing/test_pdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3466,16 +3466,19 @@ def __getitem__(self, name):
raise IndexError()
return globals()[name]

def __setitem__(self, name, value): # pdb assigns to f_locals itself.
def __setitem__(self, name, value):
# pdb assigns to f_locals itself.
self.values.append((name, value))

def fn():
m = M()
set_trace()
exec("print(1)", {}, M())
exec("print(1)", {}, m)
assert m.values == [('__return__', None)]

check(fn, r"""
[NUM] > .*fn()
-> exec("print(1)", {}, M())
-> exec("print(1)", {}, m)
5 frames hidden (try 'help hidden_frames')
# s
--Call--
Expand Down