From a921847ae80d51d451a2e73af3b68070479c42b2 Mon Sep 17 00:00:00 2001 From: David Miguel Susano Pinto Date: Mon, 20 Mar 2023 17:40:06 +0000 Subject: [PATCH] microscope/stages/linkam.py: use CDLL instead of WinDLL even on Windows (#261) --- microscope/stages/linkam.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/microscope/stages/linkam.py b/microscope/stages/linkam.py index 9caae161..29eb8c2e 100644 --- a/microscope/stages/linkam.py +++ b/microscope/stages/linkam.py @@ -974,10 +974,9 @@ def get_sdk_version(): @staticmethod def init_sdk(): """Initialise the SDK and set up event callbacks""" - try: - __class__._lib = ctypes.WinDLL("LinkamSDK.dll") - except: - # Not tested + if os.name == "nt": # is windows + __class__._lib = ctypes.CDLL("LinkamSDK.dll") + else: # assuming Linux. Not tested. __class__._lib = ctypes.CDLL("libLinkamSDK.so") _lib = __class__._lib """Initialise the SDK, and create and set the callbacks."""