Commit db1a7dab authored by Stefan Behnel's avatar Stefan Behnel

Merge branch '0.29.x'

parents 1cc58b51 cb53a50c
......@@ -593,6 +593,11 @@ Bugs fixed
Also, related C compiler warnings about deprecated C-API usage were resolved.
(Github issue #3925)
* The attributes ``gen.gi_frame`` and ``coro.cr_frame`` of Cython compiled
generators and coroutines now return an actual frame object for introspection,
instead of ``None``.
(Github issue #2306)
0.29.23 (2021-04-14)
====================
......
......@@ -1873,7 +1873,7 @@ static PyGetSetDef __pyx_Generator_getsets[] = {
{(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
(char*) PyDoc_STR("qualified name of the generator"), 0},
{(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
(char*) PyDoc_STR("Frame of the coroutine"), 0},
(char*) PyDoc_STR("Frame of the generator"), 0},
{0, 0, 0, 0, 0}
};
......
......@@ -561,3 +561,23 @@ def test_generator_kwds3(**kwargs):
a
"""
yield from kwargs.keys()
def test_generator_frame(a=1):
"""
>>> gen = test_generator_frame()
>>> import types
>>> isinstance(gen.gi_frame, types.FrameType) or gen.gi_frame
True
>>> gen.gi_frame is gen.gi_frame # assert that it's cached
True
>>> gen.gi_frame.f_code is not None
True
>>> code_obj = gen.gi_frame.f_code
>>> code_obj.co_argcount
1
>>> code_obj.co_varnames
('a', 'b')
"""
b = a + 1
yield b
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment