lsgunth / pyft232

Python bindings to d2xx and libftdi to access FT232 chips with the same interface as pyserial
GNU Lesser General Public License v2.1
11 stars 11 forks source link

Error `name 'ftdi' is not defined` when native library isn't installed #21

Closed qwertychouskie closed 6 months ago

qwertychouskie commented 6 months ago

The issue is in pyft232/ft232/libftdi.py, in lines 30/31 any exception loading the library is ignored, but then in line 36 it tries to use ftdi despite the fact that the object is not created if there is an error. Instead, lines 30/31 should throw a meaningful exception that tells the user that the native library was not found.

lsgunth commented 6 months ago

Patches welcome!