-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing on Windows systems results in an AttributeError #56
Comments
This library is mostly used for Home Assistant which only supports WSL. I don't have a windows machine to test with but I'm happy to merge a fix as long as it doesn't break WSL |
Ok, I'll also test this on macOS and add a check on the operating system for a conditional import. I'll open a PR soon. |
There's no problem on macOS. However, looking at it deeper, it seems the problem on Windows is only because socket.CMSG_LEN isn't defined on Windows and is used in dbus-fast's unmarshaller module. Wouldn't the cleanest way to fix this be an alternative implementation for |
|
Got it. Fixed and tested on Linux, Windows and macOS. |
Describe the bug
Importing the module on Windows systems results in an
AttributeError
becausebluetooth-adapters
tries to access D-Bus.To Reproduce
Run
from bluetooth_adapters import get_adapters
on Windows.Minimal example:
Get a stack trace like this one (from other code than the above):
Additional context
Removing lines 12-17 from bluetooth_adapters/__init__.py makes the code work on Windows:
The code should probably only import from the
dbus
module on Linux?The text was updated successfully, but these errors were encountered: