|
From: <bc...@wo...> - 2001-04-17 16:23:38
|
[Schmidmeier, Arno] >Hello, >I have following problem. >I have a Jython Interpreter embeded in a Java-application. Whenever I >execute > >import re > >in the embedded application, I get following error: > >Traceback (innermost last): > File "<string>", line 1, in ? > File "C:\Programme\Jython\Lib\re.py", line 28, in ? > File "C:\Programme\Jython\Lib\sre.py", line 17, in ? > File "C:\Programme\Jython\Lib\sre_compile.py", line 15, in ? >AttributeError: class 'org.python.modules._sre' has no attribute 'MAGIC' > > >When I execute it from the "commandline" >nothing happens. > >Jython 2.1a1 on java1.3.0_01 (JIT: null) >Type "copyright", "credits" or "license" for more information. >>>> import re >>>> > >I do not call PySystemState.initialize nor di I call ><>Interpreter.initialise. However >python.home and install.root are defined in the Java.lang.System.Properties? > >Any comments? It sounds like a version mismatch. In the released Jython-2.0 neither the "sre_compile" nor the "_sre" module contained a MAGIC field. In the 2.1 series a MAGIC field was added to both modules. I guess your embedded use of jython picks up a different and more recent version of the standard library. It can be a library from either Jython 2.1a1 or CPython 2.1. regards, finn |