diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-06-29 16:04:48 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-06-29 16:04:48 +0200 |
| commit | c128cb06819832929f96122beb567f23b0d7aa99 (patch) | |
| tree | 89f0f397de0f6bbc3f48cb026fdd527b6c068952 /wrappers/python | |
| parent | 8fbe53fb2f90ca7c7410621581abca35bc3e749c (diff) | |
Python: Load normal library path before loading absolute path
Diffstat (limited to 'wrappers/python')
| -rw-r--r-- | wrappers/python/src/__init__.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/wrappers/python/src/__init__.py b/wrappers/python/src/__init__.py index 8129495..1ec0bec 100644 --- a/wrappers/python/src/__init__.py +++ b/wrappers/python/src/__init__.py @@ -23,8 +23,15 @@ _os = platform.system().lower() _libname = "eduvpn_common" _libfile = f"{_lib_prefixes[_os]}{_libname}{_lib_suffixes[_os]}" -# Library should have been copied to the lib/ folder -lib = cdll.LoadLibrary(str(pathlib.Path(__file__).parent / "lib" / _libfile)) + +lib = None + +# Try to load in the normal path +try: + lib = cdll.LoadLibrary(_libfile) +# Otherwise, library should have been copied to the lib/ folder +except: + lib = cdll.LoadLibrary(str(pathlib.Path(__file__).parent / "lib" / _libfile)) class DataError(Structure): |
