This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xdegaye
Recipients asvetlov, georg.brandl, gvanrossum, xdegaye
Date 2012-12-06.19:44:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1354823061.62.0.657058835156.issue16596@psf.upfronthosting.co.za>
In-reply-to
Content
In the test named 'test_pdb_return_command_for_generator' in the patch, the
return command does not cause pdb to stop at the StopIteration debug event as
expected. Instead the following step command steps into the generator.

With the patch applied, in the following debugging session, pdb does not stop
after the 'next' command.  Pdb should stop to stay consistent with the way
'next' behaves in the same case on a plain function.

===   bar.py   ===
def g():
    yield 0

it = g()
while True:
    try:
        x = next(it)
        print(x)
    except StopIteration:
        break
==================
$ ./python -m pdb /tmp/bar.py
> /tmp/bar.py(1)<module>()
-> def g():
(Pdb) break g
Breakpoint 1 at /tmp/bar.py:1
(Pdb) continue
> /tmp/bar.py(2)g()
-> yield 0
(Pdb) next
0
The program finished and will be restarted
> /tmp/bar.py(1)<module>()
-> def g():
(Pdb)
==================
History
Date User Action Args
2012-12-06 19:44:21xdegayesetrecipients: + xdegaye, gvanrossum, georg.brandl, asvetlov
2012-12-06 19:44:21xdegayesetmessageid: <1354823061.62.0.657058835156.issue16596@psf.upfronthosting.co.za>
2012-12-06 19:44:21xdegayelinkissue16596 messages
2012-12-06 19:44:21xdegayecreate