summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/gen_context2.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-04-17 05:49:47 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2014-04-17 20:27:00 +0300
commitb7e90ea07890392b7e31ae5079a539b474b16d81 (patch)
tree9be43cfa538ff0387de837c2b44ec1481bc23997 /tests/basics/gen_context2.py
parentf26a30710c77299a715318bc487e1874d1bf9984 (diff)
downloadmicropython-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.py2
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)