Skip to content

Commit e9252de

Browse files
authored
PCAN: Fix detection of lib on Windows on ARM (hardbyte#1463)
Before this commit detection of the PCAN DLL would fail on Windows on ARM, regardless if you used the native Python version, or the x64 version of Python. After this fix detection should work properly as long as the PCAN library for your version of Python is listed first in the `PATH` variable. The default: 1. `C:\Program Files\PEAK-System\PEAK-Drivers 4\APIs\ARM64\` before 2. `C:\Program Files\PEAK-System\PEAK-Drivers 4\APIs\x64\` should work if you use the (native) ARM version of Python. If you reorder these paths, then loading the library works in the x64 version of Python. This commit closes hardbyte#1461.
1 parent 6d41056 commit e9252de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

can/interfaces/pcan/basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ def __init__(self):
658658
#
659659
if platform.system() == "Windows":
660660
# Loads the API on Windows
661-
self.__m_dllBasic = windll.LoadLibrary("PCANBasic")
661+
self.__m_dllBasic = windll.LoadLibrary(find_library("PCANBasic"))
662662
aReg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
663663
try:
664664
aKey = winreg.OpenKey(aReg, r"SOFTWARE\PEAK-System\PEAK-Drivers")

0 commit comments

Comments
 (0)