Message6064

Author babelmania
Recipients babelmania
Date 2010-09-14.12:49:41
SpamBayes Score 9.0084304e-09
Marked as misclassified No
Message-id <1284468583.35.0.292780427805.issue1653@psf.upfronthosting.co.za>
In-reply-to
Content
Whenever mixing Jython and Java class in the same package structure and the Java class is not explicitly mentioned in __init__.py, the module fails to find it in subsequent import calls.


from foo import bar // OK
from foo import Foo // ERROR

(Yes, we are able to mix java and jython code within the same structure since Jython 2.1 and managed to make it work under Jython 2.5.1 as well)

This is due to the fact that an PyModule is initialized once but  incomplete. Rather than to do a full initialization one could simply fix this by adding the following code to PyModule.

    @Override
    public PyObject __findattr_ex__(String name) {
        PyObject attr=super.__findattr_ex__(name);
        if (attr!=null)
            return attr;
        return impAttr(name);
    }


Problem found in 2.5.1 and 2.5.2b2
History
Date User Action Args
2010-09-14 12:49:44babelmaniasetrecipients: + babelmania
2010-09-14 12:49:43babelmaniasetmessageid: <1284468583.35.0.292780427805.issue1653@psf.upfronthosting.co.za>
2010-09-14 12:49:43babelmanialinkissue1653 messages
2010-09-14 12:49:41babelmaniacreate