From 256149dd6b82c984eab89f7d7470d15e9bae8d4b Mon Sep 17 00:00:00 2001 From: eufren <57187451+eufren@users.noreply.github.com> Date: Tue, 19 May 2020 10:48:49 +0100 Subject: [PATCH] Patch to correctly find DLL and dependencies Patch to correctly find DLL and dependencies in PATH variable on Windows. Works, but the except: pass bit is a bit janky - for some reason, it throws an error after adding all the paths otherwise. --- xfoil/xfoil.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xfoil/xfoil.py b/xfoil/xfoil.py index 4334ef6..31d3a1b 100644 --- a/xfoil/xfoil.py +++ b/xfoil/xfoil.py @@ -30,6 +30,12 @@ lib_path = glob.glob(os.path.join(here, 'libxfoil.*'))[0] lib_ext = lib_path[lib_path.rfind('.'):] +for path in os.getenv('PATH').split(os.pathsep): + try: + os.add_dll_directory(path) + except: + pass + fptr = POINTER(c_float) bptr = POINTER(c_bool)