I have sent a time ago the follwing message to the list:
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
Traceback (innermost last)
  File "C:\Python21\Lib\.\site.py\, line 74, in ?
TypeError: readonly class or attribute: __file__
Could somebody give me a hint on how to circumvent this problem.
Finn Bock kindly gave me the following instruction:
Jythonc only includes modules it can find in the sources. Unfortunately
the jython runtime can import some extra module and jythonc have no to
detect that these extra module should be included.

The warning modules, the encoding modules and xml.sax.drivers2 modules
are common examples of such runtime imports.

The workaround is to add a dummy method to your main source file:

def _dummy():
    # include these modules when compiling with jythonc
    import warnings

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 ?