On Thu, 8 Dec 2011, Andi Vajda wrote:

It seems that adding, before if __name__ == '__main__':
 from jcc import _jcc

works just fine on 2.7 and 2.6 as well.

Speaking of which, I don't see when __name__ would be == '__main__'. I tried various combinations with pdb and __name__ is always == 'jcc'.
If that makes sense to you as well, I can change that block to just say:

 from _jcc import initVM

It doesn't look like this statement is needed either.
Can you remember why it was there ? (not saying you put it there, just asking, I'm blanking)

Maybe just replacing the whole 'if __name__  ...' block with just:
  from jcc import _jcc

is enough for all cases ?
(see new version below)

Andi..

 import os, sys

 if sys.platform == 'win32':

    if '--find-jvm-dll' in sys.argv:
        from windows import add_jvm_dll_directory_to_path
        add_jvm_dll_directory_to_path()

    from jcc.config import SHARED
    if SHARED:
        path = os.environ['Path'].split(os.pathsep)
        eggpath = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
        if eggpath not in path:
            path.insert(0, eggpath)
            os.environ['Path'] = os.pathsep.join(path)

 from jcc import _jcc

 CLASSPATH=os.path.join(os.path.abspath(os.path.dirname(__file__)), "classes")
 _jcc.CLASSPATH = CLASSPATH

Reply via email to