Refs #384. Updated python bindings package for LibOpenBLT, such that it can load the shared library file from the current working directory, if it is present there.

git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@439 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
Frank Voorburg 2018-03-08 10:19:42 +00:00
parent 648c1ff798
commit 13193a3a51
1 changed files with 8 additions and 2 deletions

View File

@ -34,6 +34,7 @@ __docformat__ = 'reStructuredText'
# ***************************************************************************************
import ctypes
import sys
import os
# ***************************************************************************************
@ -55,8 +56,13 @@ else:
sharedLibrary = 'libopenblt' + sharedLibraryExt
# Get a handle to the shared library.
sharedLibraryHandle = ctypes.CDLL(sharedLibrary)
# Get a handle to the shared library. First assume that the shared library is in the
# current working directory. If not, then assume that it is located somewhere on the
# LD_LIBRARY_PATH.
if os.path.exists(os.path.join(os.getcwd(), sharedLibrary)):
sharedLibraryHandle = ctypes.CDLL(os.path.join(os.getcwd(), sharedLibrary))
else:
sharedLibraryHandle = ctypes.CDLL(sharedLibrary)
# ***************************************************************************************