|
From: Samuele P. <pe...@in...> - 2001-07-26 16:41:28
|
Hi. > > Samuele, > > The primary reason is that I have some legacy code that uses > __builtins__ that I would rather not > have to rewrite. It's an application maintain by another party and I > don't want to have to continually > sync with their copy. > > In addition, there are some neat things you can do, like dynamically > being able to re-define the behavior of builtin functions and add new > builtins... I see > The patch seems to be sound, and I don't understand why it's hitting > those null frames in the current CVS, so any ideas would be appreciated. > If the goals are those stated above the patch seems far from complete or correct. See CPython (as starting point): Objects/frameobject.c Python/import.c (PyImport_ExecCodeModuleEx) and compare with: org.python.core.PyFrame and where PyFrames are created and module execution code (in org.python.core.Py and imp) Both the place PyModule and the approach (__import__) are probably wrong. That's just the result of a quick survey of Jython and CPython code (it's not the whole picture). OTOH python __builtins__ is related to restricted execution, a thing that jython won't implement. See Jython vs CPython in the doc. The problem with the null frames is different, that should be solved anyway. regards, Samuele Pedroni. |