[pypy-svn] r34397 - pypy/dist/pypy/interpreter/test
arigo at codespeak.net
arigo at codespeak.net
Wed Nov 8 21:16:27 CET 2006
Author: arigo
Date: Wed Nov 8 21:16:27 2006
New Revision: 34397
Modified:
pypy/dist/pypy/interpreter/test/test_compiler.py
Log:
argh, nested scopes in our Python compiler are a MESS
Modified: pypy/dist/pypy/interpreter/test/test_compiler.py
==============================================================================
--- pypy/dist/pypy/interpreter/test/test_compiler.py (original)
+++ pypy/dist/pypy/interpreter/test/test_compiler.py Wed Nov 8 21:16:27 2006
@@ -465,6 +465,25 @@
space.raises_w(space.w_SyntaxError, self.compiler.compile,
snippet, '<tmp>', 'exec', 0)
+ def test_really_nested_stuff(self):
+ py.test.skip("argh, scopes are a MESS")
+ space = self.space
+ snippet = str(py.code.Source(r'''
+ def f(self):
+ def get_nested_class():
+ self
+ class Test:
+ def _STOP_HERE_(self):
+ return _STOP_HERE_(self)
+ get_nested_class()
+ f(42)
+ '''))
+ code = self.compiler.compile(snippet, '<tmp>', 'exec', 0)
+ space = self.space
+ w_d = space.newdict()
+ space.exec_(code, w_d, w_d)
+ # assert did not crash
+
class TestECCompiler(BaseTestCompiler):
def setup_method(self, method):
self.compiler = self.space.getexecutioncontext().compiler
More information about the Pypy-commit
mailing list