summaryrefslogtreecommitdiff
path: root/tests/basics/gen_yield_from.py
AgeCommit message (Collapse)Author
2018-09-20py/objgenerator: Implement PEP479, StopIteration convs to RuntimeError.Damien George
This commit implements PEP479 which disallows raising StopIteration inside a generator to signal that it should be finished. Instead, the generator should simply return when it is complete. See https://www.python.org/dev/peps/pep-0479/ for details.
2018-02-27py/vm: Fix case of handling raised StopIteration within yield from.Damien George
This patch concerns the handling of an NLR-raised StopIteration, raised during a call to mp_resume() which is handling the yield from opcode. Previously, commit 6738c1dded8e436686f85008ec0a4fc47406ab7a introduced code to handle this case, along with a test. It seems that it was lucky that the test worked because the code did not correctly handle the stack pointer (sp). Furthermore, commit 79d996a57b351e0ef354eb1e2f644b194433cc73 improved the way mp_resume() propagated certain exceptions: it changed raising an NLR value to returning MP_VM_RETURN_EXCEPTION. This change meant that the test introduced in gen_yield_from_ducktype.py was no longer hitting the code introduced in 6738c1dded8e436686f85008ec0a4fc47406ab7a. The patch here does two things: 1. Fixes the handling of sp in the VM for the case that yield from is interrupted by a StopIteration raised via NLR. 2. Introduces a new test to check this handling of sp and re-covers the code in the VM.
2014-07-05tests: Rename test scripts, changing - to _ for consistency.Damien George
From now on, all new tests must use underscore. Addresses issue #727.