Skip to content

Commit a921847

Browse files
author
David Miguel Susano Pinto
committed
microscope/stages/linkam.py: use CDLL instead of WinDLL even on Windows (#261)
1 parent 85a4448 commit a921847

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

microscope/stages/linkam.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -974,10 +974,9 @@ def get_sdk_version():
974974
@staticmethod
975975
def init_sdk():
976976
"""Initialise the SDK and set up event callbacks"""
977-
try:
978-
__class__._lib = ctypes.WinDLL("LinkamSDK.dll")
979-
except:
980-
# Not tested
977+
if os.name == "nt": # is windows
978+
__class__._lib = ctypes.CDLL("LinkamSDK.dll")
979+
else: # assuming Linux. Not tested.
981980
__class__._lib = ctypes.CDLL("libLinkamSDK.so")
982981
_lib = __class__._lib
983982
"""Initialise the SDK, and create and set the callbacks."""

0 commit comments

Comments
 (0)