diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-17 05:49:47 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-04-17 20:27:00 +0300 |
commit | b7e90ea07890392b7e31ae5079a539b474b16d81 (patch) | |
tree | 9be43cfa538ff0387de837c2b44ec1481bc23997 /tests/basics/gen_context2.py | |
parent | f26a30710c77299a715318bc487e1874d1bf9984 (diff) | |
download | micropython-b7e90ea07890392b7e31ae5079a539b474b16d81.tar.gz micropython-b7e90ea07890392b7e31ae5079a539b474b16d81.zip |
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.
Diffstat (limited to 'tests/basics/gen_context2.py')
-rw-r--r-- | tests/basics/gen_context2.py | 2 |
1 files changed, 2 insertions, 0 deletions
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) |