Skip to content
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

better pyserial embed detection #15

Open
whaleygeek opened this issue Aug 3, 2017 · 1 comment
Open

better pyserial embed detection #15

whaleygeek opened this issue Aug 3, 2017 · 1 comment

Comments

@whaleygeek
Copy link
Owner

bitio uses code to detect whether it has loaded the pyserial embedded in the project, or whether sys pathing has meant that it found a (possibly incompatible and buggy) system installed one. Ubuntu 12 for example has a slightly buggy version of pyserial installed by default, which is why we package pyserial inside bitio to avoid this being used.

However, currently bitio looks for existence of a hacked-in 'BITIO' module attribute added to pyserial - this works nicely, but makes it slightly harder for people to update their embedded pyserial package without breaking this.

I had an idea that we could check the sys.modules["bitio"].__file__ attribute to find out which path was actually used to import the module (inside the outer package), and checking the basename of the path could tell us if it actually found the system installed one or the embedded one. This would make the pyserial embedded inside bitio completely unchanged from the original source.

@whaleygeek
Copy link
Owner Author

I have a fix for this in another project, I just need to bring in the modified code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant