File tree 2 files changed +6
-3
lines changed
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 51
51
xldriver : Optional [ModuleType ] = None
52
52
try :
53
53
from . import xldriver
54
- except Exception as exc :
54
+ except FileNotFoundError as exc :
55
55
LOG .warning ("Could not import vxlapi: %s" , exc )
56
56
57
57
WaitForSingleObject : Optional [Callable [[int , int ], int ]]
Original file line number Diff line number Diff line change 8
8
import ctypes
9
9
import logging
10
10
import platform
11
+ from ctypes .util import find_library
11
12
12
13
from . import xlclass
13
14
from .exceptions import VectorInitializationError , VectorOperationError
16
17
17
18
# Load Windows DLL
18
19
DLL_NAME = "vxlapi64" if platform .architecture ()[0 ] == "64bit" else "vxlapi"
19
- _xlapi_dll = ctypes .windll .LoadLibrary (DLL_NAME )
20
-
20
+ if dll_path := find_library (DLL_NAME ):
21
+ _xlapi_dll = ctypes .windll .LoadLibrary (dll_path )
22
+ else :
23
+ raise FileNotFoundError (f"Vector XL library not found: { DLL_NAME } " )
21
24
22
25
# ctypes wrapping for API functions
23
26
xlGetErrorString = _xlapi_dll .xlGetErrorString
You can’t perform that action at this time.
0 commit comments