From 48366f7075b34308c148c24d6af808940677fe58 Mon Sep 17 00:00:00 2001
From: Melven Roehrig-Zoellner <Melven.Roehrig-Zoellner@DLR.de>
Date: Thu, 4 Feb 2021 00:06:39 +0100
Subject: [PATCH] Fix ctypes DLL loading in Python>=3.8 (new policy)

---
 bindings/bindings_generator/python_generator.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bindings/bindings_generator/python_generator.py b/bindings/bindings_generator/python_generator.py
index 0163535..1b9e516 100644
--- a/bindings/bindings_generator/python_generator.py
+++ b/bindings/bindings_generator/python_generator.py
@@ -120,7 +120,7 @@ class PythonGenerator(object):
         
         string += indent + 'try:\n'
         string += indent + '    if sys.platform == \'win32\':\n'
-        string += indent + '        lib = ctypes.cdll.%s\n' % self.libname
+        string += indent + '        lib = ctypes.cdll.LoadLibrary("lib%s.dll")\n' % self.libname
         string += indent + '    elif sys.platform == \'darwin\':\n'
         string += indent + '        lib = ctypes.CDLL("lib%s.dylib")\n' % self.libname
         string += indent + '    else:\n'
-- 
2.30.0.windows.2

