Skip to content

Commit 4526f53

Browse files
authored
Merge pull request LeeKamentsky#179 from DavidStirling/master
Fix DLL imports for Python 3.8
2 parents 9075654 + a7d88f5 commit 4526f53

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

javabridge/jutil.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ def _find_jvm():
149149
#
150150
os.environ["PATH"] = os.environ["PATH"] + os.pathsep + _find_jvm() + \
151151
os.pathsep + os.path.join(find_javahome(), "bin")
152+
try:
153+
os.add_dll_directory(_find_jvm())
154+
os.add_dll_directory(os.path.join(find_javahome(), "bin"))
155+
except AttributeError:
156+
logger.debug("DLL directories not added to environment, may cause problems in Python 3.8+")
152157

153158
elif sys.platform == "darwin":
154159
# Has side-effect of preloading dylibs

0 commit comments

Comments
 (0)