Fix odrivetool by adding the dll path on windows

This commit is contained in:
Matt Quick
2021-04-14 21:27:41 -04:00
committed by PAJohnson
parent f7a173cd9b
commit c0e9dc2d1f
+10 -2
View File
@@ -68,8 +68,16 @@ if os.path.getsize(lib_path) < 1000:
" 3. Run `git lfs install`\n"
" 4. Run `git lfs pull`".format(lib_path, os.path.dirname(lib_path)))
lib = windll.LoadLibrary(lib_path) if os.name == 'nt' else cdll.LoadLibrary(lib_path)
if os.name == 'nt':
dll_dir = os.path.dirname(lib_path)
try:
# New way in python 3.8+
os.add_dll_directory(dll_dir)
except:
os.environ['PATH'] = dll_dir + os.pathsep + os.environ['PATH']
lib = windll.LoadLibrary(lib_path)
else:
lib = cdll.LoadLibrary(lib_path)
# libfibre definitions --------------------------------------------------------#