-
Notifications
You must be signed in to change notification settings - Fork 42
Closed
Labels
Description
E.g., from the Products.PythonScripts fibonacci test:
l = []
a, b = 0, 1
while b < 100000000:
l.append(b)
a, b = b, a+b # fails with error
return lThe error is:
> /home/tseaver/.buildout/eggs/cp27m/RestrictedPython-4.0a1-py2.7.egg/RestrictedPython/tests/verify.py(45)verify()
-> verify(ob)
(Pdb) d
> /home/tseaver/.buildout/eggs/cp27m/RestrictedPython-4.0a1-py2.7.egg/RestrictedPython/tests/verify.py(42)verify()
-> verifycode(code)
(Pdb) d
> /home/tseaver/.buildout/eggs/cp27m/RestrictedPython-4.0a1-py2.7.egg/RestrictedPython/tests/verify.py(50)verifycode()
-> _verifycode(code)
(Pdb) d
> /home/tseaver/.buildout/eggs/cp27m/RestrictedPython-4.0a1-py2.7.egg/RestrictedPython/tests/verify.py(110)_verifycode()
-> (code.co_filename, line))
(Pdb) l
105 if not (window[0].opname == "CALL_FUNCTION" and
106 window[1].opname == "ROT_TWO" and
107 window[2].opname == "LOAD_GLOBAL" and
108 window[2].arg == "_getiter_"):
109 raise ValueError("unguarded unpack sequence at %s:%d" %
110 -> (code.co_filename, line))
111
112 # should check CALL_FUNCTION_{VAR,KW,VAR_KW} but that would
113 # require a potentially unlimited history. need to refactor
114 # the "window" before I can do that.
115