-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
bpo-21161: pdb: default: handle list comprehensions #15194
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
Conversation
test_gdb crashed on Azure (https://dev.azure.com/Python/cpython/_build/results?buildId=48361&view=logs&j=c83831cd-3752-5cc7-2f01-8276919eb334):
(retrying) |
00fac9a
to
ff84fb3
Compare
Congrats for the work here :) |
I do not think it is necessary really - the test proves that the namespace is handled properly/differently already. |
def test_list_comprehensions(self): | ||
script = """ | ||
def f(): | ||
mylocal = "init_mylocal" # noqa: F841 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the comment mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Local variable name is assigned to but never used (F841)
commands = """ | ||
continue | ||
|
||
p "mylocal:" + mylocal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this line in the test?
@@ -362,7 +362,8 @@ def displayhook(self, obj): | |||
def default(self, line): | |||
if line[:1] == '!': line = line[1:] | |||
locals = self.curframe_locals | |||
globals = self.curframe.f_globals | |||
ns = self.curframe.f_globals.copy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What it the code that is being debugged changes globals()
? This would mean any changes to self.curframe.f_globals by the calling code is dropped, is it not?
The linked issue was fixed by #111094; closing this since the linked issue is now resolved. Thanks for your interest in improving CPython! |
Fixes https://bugs.python.org/issue21161.
TODO:
https://bugs.python.org/issue21161