From b7e90ea07890392b7e31ae5079a539b474b16d81 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 17 Apr 2014 05:49:47 +0300 Subject: objgenerator: Generator must execute in its defining lexical context. I.e. with its own globals. So, just as for functions, we need to switch globals when resuming a generator. --- tests/basics/gen_context2.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/basics/gen_context2.py (limited to 'tests/basics/gen_context2.py') diff --git a/tests/basics/gen_context2.py b/tests/basics/gen_context2.py new file mode 100644 index 0000000000..0d8048afcc --- /dev/null +++ b/tests/basics/gen_context2.py @@ -0,0 +1,2 @@ +def call(g): + next(g) -- cgit v1.2.3