Open aaroncwhite opened 4 years ago
Hey @aaroncwhite, thanks for the pull request!
Is there any particular reason to always want to use smbus2 over the standard python(3)-smbus package? If not, I rather keep this merge request open and refer to it in the README, to have the standard smbus package as the default and let people know that someone also made a fork using smbus2.
What about this ?
import imp
try:
imp.find_module('smbus')
import smbus
except ImportError as e:
import smbus2 as smbus
@ThinkalVB this assumes that if the regular smbus is not available, then smbus2 will be available and/or you want to use smbus2. Which is an assumption that you probably should not make. I think it is better for users to explicitly choose which smbus version they use, either by using the master branch or using the fork by @aaroncwhite.
Hey, thanks for the library! I've had to update to smbus2 so it plays nice with another library. Figure it might be useful. Not sure if this is still maintained, but just in case!