Message10183
I just worked out and tested variant 2):
if not sys.executable is None:
project_base = os.path.dirname(os.path.realpath(sys.executable))
else:
from java.lang import System
from java.io import File as jFile
cpstr = System.getProperty('java.class.path')
cps = cpstr.split(jFile.pathSeparator)
for fl in cps:
file = jFile(fl)
if (file.isFile()):
fn = file.getName()
if (fn.startswith("jython") and fn.endswith(".jar")):
project_base = file.getParentFile().getAbsolutePath()+jFile.separator+"bin"
It appears to be working fine, at least if jython.jar was not renamed to something cumbersome. Still, this should avoid the problem in 99.9% of the cases. If there are no objections, I would merge this into master.
Cheers |
|
Date |
User |
Action |
Args |
2015-08-30 13:26:57 | stefan.richthofer | set | messageid: <1440941217.55.0.924735338666.issue2386@psf.upfronthosting.co.za> |
2015-08-30 13:26:57 | stefan.richthofer | set | recipients:
+ stefan.richthofer |
2015-08-30 13:26:57 | stefan.richthofer | link | issue2386 messages |
2015-08-30 13:26:57 | stefan.richthofer | create | |
|