Andi Vajda <va...@apache.org> wrote: > It seems that adding, before if __name__ == '__main__': > from jcc import _jcc > > works just fine on 2.7 and 2.6 as well.
Yes, this works on 2.5, 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 I put a print statement in... When you invoke it with Python 2.5 as "python -m jcc", __name__ is "__main__". That's what runs the code, so I don't think you can remove it. > I'm prepared to roll an rc3 if you confirm that these changes (see > below) work for you too. > > 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 > from _jcc import initVM > > CLASSPATH=os.path.join(os.path.abspath(os.path.dirname(__file__)), "classes") > _jcc.CLASSPATH = CLASSPATH No, this doesn't work, but I don't understand the failure... % /usr/bin/python -m jcc --shared --jar lucene-java-3.5.0/lucene/build/lucene-core-3.5.0.jar --jar lucene-java-3.5.0/lucene/build/contrib/analyzers/common/lucene-analyzers-3.5.0.jar --jar lucene-java-3.5.0/lucene/build/contrib/memory/lucene-memory-3.5.0.jar --jar lucene-java-3.5.0/lucene/build/contrib/highlighter/lucene-highlighter-3.5.0.jar --jar build/jar/extensions.jar --jar lucene-java-3.5.0/lucene/build/contrib/queries/lucene-queries-3.5.0.jar --jar lucene-java-3.5.0/lucene/build/contrib/grouping/lucene-grouping-3.5.0.jar --jar lucene-java-3.5.0/lucene/build/contrib/join/lucene-join-3.5.0.jar --jar lucene-java-3.5.0/lucene/build/contrib/facet/lucene-facet-3.5.0.jar --jar lucene-java-3.5.0/lucene/build/contrib/spellchecker/lucene-spellchecker-3.5.0.jar --package java.lang java.lang.System java.lang.Runtime --package java.util java.util.Arrays java.util.HashMap java.util.HashSet java.text.SimpleDateFormat java.text.DecimalFormat java.text.Collator --package java.util.rege x --package java.io java.io.StringReader java.io.InputStreamReader java.io.FileInputStream --exclude org.apache.lucene.queryParser.Token --exclude org.apache.lucene.queryParser.TokenMgrError --exclude org.apache.lucene.queryParser.QueryParserTokenManager --exclude org.apache.lucene.queryParser.ParseException --exclude org.apache.lucene.search.regex.JakartaRegexpCapabilities --exclude org.apache.regexp.RegexpTunnel --exclude org.apache.lucene.analysis.cn.smart.AnalyzerProfile --python lucene --mapping org.apache.lucene.document.Document 'get:(Ljava/lang/String;)Ljava/lang/String;' --mapping java.util.Properties 'getProperty:(Ljava/lang/String;)Ljava/lang/String;' --sequence java.util.AbstractList 'size:()I' 'get:(I)Ljava/lang/Object;' --rename org.apache.lucene.search.highlight.SpanScorer=HighlighterSpanScorer --version 3.5.0 --module python/collections.py --module python/ICUNormalizer2Filter.py --module python/ICUFoldingFilter.py --module python/ICUTransformFilter.py --file s 4 --build Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/runpy.py", line 95, in run_module filename, loader, alter_sys) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/runpy.py", line 52, in _run_module_code mod_name, mod_fname, mod_loader) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/runpy.py", line 32, in _run_code exec code in run_globals File "/Library/Python/2.5/site-packages/JCC-2.12-py2.5-macosx-10.5-i386.egg/jcc/__init__.py", line 33, in <module> from _jcc import initVM ImportError: No module named _jcc make: *** [compile] Error 255 % Bill