File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -66,14 +66,20 @@ def __init__(self, name):
6666 def _load (self ):
6767 library_path = find_library (self .name )
6868
69- if library_path is None :
70- env_var_name = "PATH" if sys .platform == 'win32' else "LD_LIBRARY_PATH"
71- raise CannotFindPicoSDKError ("PicoSDK (%s) not found, check %s" % (self .name , env_var_name ))
69+ # 'find_library' fails in Cygwin.
70+ if not sys .platform == 'cygwin' :
71+ if library_path is None :
72+ env_var_name = "PATH" if sys .platform == 'win32' else "LD_LIBRARY_PATH"
73+ raise CannotFindPicoSDKError ("PicoSDK (%s) not found, check %s" % (self .name , env_var_name ))
7274
7375 try :
7476 if sys .platform == 'win32' :
7577 from ctypes import WinDLL
7678 result = WinDLL (library_path )
79+ elif sys .platform == 'cygwin' :
80+ from ctypes import CDLL
81+ library_path = self .name
82+ result = CDLL (library_path + ".dll" )
7783 else :
7884 from ctypes import cdll
7985 result = cdll .LoadLibrary (library_path )
You can’t perform that action at this time.
0 commit comments