|
From: Samuele P. <pe...@in...> - 2001-05-27 19:25:08
|
Hi
[Rich Seddon]
> However, by running jdb I found the spot where these are being lost.
> In PyModule.java, there is a method called "impHook", which has the
> following lines.
>
> private static PyObject impHook(String name) {
> if (silly_list == null) {
> silly_list = new PyTuple(new PyString[] {
> Py.newString("__doc__"),});
> }
> try {
> return __builtin__.__import__(name, null, null, silly_list);
> } catch(PyException e) {
> return null;
> }
> }
>
> The SyntaxError gets caught here, and is never seen again. :-)
>
> Is there a fix/workaround for this?
I think we could simply remove the try/catch. Any other ideas?
Note: (if I remember well) this code is only called if one tries to load a
jython package as:
import jypkg1
jypkg1.jypkg2.foofunc()
this is supported by jython but the correct python code would use:
import jypkg1.jypkg2
In python one cannot refer to packages without first importing them.
regards, Samuele Pedroni.
|