Merge pull request #107 from baztian/Thrameos-jpype_0.7.0
Some changes required to support jpype 0.7.0 (unfinished)master
commit
3e6e2484f0
|
|
@ -173,7 +173,19 @@ def _jdbc_connect_jpype(jclassname, url, driver_args, jars, libs):
|
||||||
# jvm_path = ('/usr/lib/jvm/java-6-openjdk'
|
# jvm_path = ('/usr/lib/jvm/java-6-openjdk'
|
||||||
# '/jre/lib/i386/client/libjvm.so')
|
# '/jre/lib/i386/client/libjvm.so')
|
||||||
jvm_path = jpype.getDefaultJVMPath()
|
jvm_path = jpype.getDefaultJVMPath()
|
||||||
jpype.startJVM(jvm_path, *args)
|
jpype_ver = 0.
|
||||||
|
if hasattr(jpype, '__version__'):
|
||||||
|
try:
|
||||||
|
ver_match = re.match('\d+\.\d+', jpype.__version__)
|
||||||
|
if ver_match:
|
||||||
|
jpype_ver = float(ver_match.group(0))
|
||||||
|
except ValueError:
|
||||||
|
pass
|
||||||
|
if jpype_ver < 0.7:
|
||||||
|
jpype.startJVM(jvm_path, *args)
|
||||||
|
else:
|
||||||
|
jpype.startJVM(jvm_path, *args, ignoreUnrecognized=True,
|
||||||
|
convertStrings=True)
|
||||||
if not jpype.isThreadAttachedToJVM():
|
if not jpype.isThreadAttachedToJVM():
|
||||||
jpype.attachThreadToJVM()
|
jpype.attachThreadToJVM()
|
||||||
if _jdbc_name_to_const is None:
|
if _jdbc_name_to_const is None:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue