I am trying to see if it is possible to convert a running application to =
Java. I do not get any problems usin 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.
Instituto Nacional de Tecnica Aeroespacial
Departamento de Observaci=F3n de la Tierra, Teledetecci=F3n y =
Carretera de Ajalvir, Km 4
28850 Torrejon de Ardoz
Tel +34 91 677 41 30
+34 91 677 41 90
+34 91 305 16 52
Fax +34 91 677 46 46
Email severinofer@... =20
>I am trying to see if it is possible to convert a running application to
>Java. I do not get any problems usin 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.
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:
# include these modules when compiling with jythonc
The function does not have to be called, it just have to be there.