> web.py is a great framework, but this is bad coding for sure. > I guess you need to do some hack like, > > oldbuiltins=__builtins__ > __builtins__ = {} > > Then before calling code that breaks, > __builtins__ = oldbuiltins > > <call breaking code here> > > But this is damn ugly and if it were me, I would investigate other > options whch doesn't force me to put __builtins__ to {} in my > code. I don't know details enough to advise you on this > specifically in this case.
Not really! What it does is something like this: code = generate_code(template) env = {'__builtins__': custom_builtins} exec(code, env) _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers