From: Michel A. <Mic...@st...> - 2006-02-17 08:49:55
|
> Michel Albert wrote: > > On Thursday 16 February 2006 15:20, Kent Johnson wrote: >=20 > > Thanks. This helped. I did a "print ':'.join(sys.path)" in both python > > used it's output as parameter, so it read as follows (verbose but it > > worked):=20 > >=20 > > <code>[...]</code> > >=20 > > This worked for the jython interpreter. Running it in java (through > > eclipse) gives me an overflow warning: > >=20 > > <code> > > Exception in thread "main" Traceback (innermost last): > > File "<string>", line 1, in ? > > File "/usr/lib/python2.4/warnings.py", line 258, in ? > > NameError: OverflowWarning > > </code> >=20 > Again I will say it is a very bad idea using your python path for=20 > Jython. This is an example why - you are getting Python's implementation= =20 > of warnings instead of Jython's. This is a recipe for quick disaster and= =20 > much heartache. >=20 > >>Setting python.path to be the same path used by CPython seems like a bad > >>idea to me, many CPython modules will not work with Jython. Alright. I see. A clear case of misunderstanding /what/ jython is then ;) [...] Hmmm.... I simply wrote a line "interp.exec("print sys.path");" into java a= nd=20 put the "rematch" module under the folder that was mentioned there. I suppo= se=20 that's the proper jython library path. Clearly it finds it, but it gives me= =20 on obscure error. It gives me a proper backtrace. However, the lines it=20 mentions in the trace do not contain any obvious errors: <code> /home/malbert/development/workspace/TableManager/lib/Lib/rematch/Field.py:5= 3: [SyntaxWarning]: local name 'opName' in 'delOperation' shadows use as globa= l=20 in nested scopes /home/malbert/development/workspace/TableManager/lib/Lib/rematch/Fieldgroup= =2Epy:62: [SyntaxWarning]: local name 'fld' in 'delField' shadows use as global in=20 nested scopes Exception in thread "main" Traceback (innermost last): File "<string>", line 1, in ? File=20 "/home/malbert/development/workspace/TableManager/lib/Lib/rematch/Fieldgrou= p.py",=20 line 22, in ? File=20 "/home/malbert/development/workspace/TableManager/lib/Lib/rematch/Fieldgrou= p.py",=20 line 29, in Fieldgroup NameError: True </code> Here's the mentioned lines of code: <code> =46ieldgroup.py =2D----------------------------------------------------- 22:class Fieldgroup: 29: def __init__(self, name, isUnique =3D True): 62: def delField(self, fld): =46ield.py =2D----------------------------------------------------- 53: def delOperation(self, opName): </code> I think I have an idea what this "x shadows use as global in nested scopes"= =20 means, but to me it does not make sense in the current context. I tried=20 renaming the variable names as I thought it might be a name conflict, but t= he=20 same error remained :( Googling on that error was also not really helpful :( |