I have sent a time ago the follwing message to the
I am trying to see if it is possible to convert a
running application to Java. I do not get any problems using jythonc with the
application, it compiles all the modules building up the application. But when I
try tu run the main class (with java from JDK 1.3), it stops telling me that the
module "warnings" could not be loaded.
I tried to trick it out compiling the modules in
the Python21\Lib directory, where warnings.py resides, but in this case the
compilation aborts with the following message:
error importing site
File "C:\Python21\Lib\.\site.py\, line 74, in ?
readonly class or attribute: __file__
Could somebody give me a hint on how to circumvent
Finn Bock kindly gave me the following
Jythonc only includes modules it can find in the
the jython runtime can import some extra module and
jythonc have no to
detect that these extra module should be
The warning modules, the encoding modules and xml.sax.drivers2
are common examples of such runtime imports.
The workaround is
to add a dummy method to your main source file:
# include these modules when compiling with
The function does not have
to be called, it just have to be there.
At that time I had to interrupt my intent because
of other more critical tasks. Now I come back to the problem, and I have tried
Finn´s recommendation, but it does not work. In fact, the warnings package is
imported by the application. The problem seems to be with the error message when
I try to compile the contents of the Lib directory.
Could still someone recommend any way to proceed