Tigge / openant

ANT and ANT-FS Python Library
MIT License
174 stars 80 forks source link

Fix problem with pyusb 1.0.2 #93

Closed robho closed 7 months ago

robho commented 7 months ago

USBTimeoutError was introduced in pyusb 1.1.0, so we need to check pyusb version before using it.

tuna-f1sh commented 7 months ago

Thanks. I wonder if it would be better to change the psusb requirement https://github.com/Tigge/openant/blob/master/setup.py#L137 . I guess this also fixes it for people just pulling the code and not updating the environment.

I've been meaning to update the the build tool to pyproject PEP-621 in favour of the legacy setup.py so I'll change the version as part of that.

tuna-f1sh commented 7 months ago

I don't see how this change fixes #95 or https://github.com/Tigge/antfs-cli/issues/194 however. The line changed in this PR is just a logger output. The exception is raised in https://github.com/Tigge/openant/blob/master/openant/easy/filter.py#L62

Are you sure you didn't update pyusb in the process of changing this code?

robho commented 7 months ago

It's ok if you bump pyusb dependency to a higher version. Feel free to close this if you bump the dependency.

(This doesn't fix #94 or #95. This is a separate fix for a problem I encountered in my environment - logging failed / raised an exception because I was using pyusb 1.0.2)