Skip to content

Verify drivers correctly import struct #782

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

Closed
tannewt opened this issue Apr 27, 2018 · 2 comments
Closed

Verify drivers correctly import struct #782

tannewt opened this issue Apr 27, 2018 · 2 comments

Comments

@tannewt
Copy link
Member

tannewt commented Apr 27, 2018

In 2.x struct is available as ustruct. We need to make sure all drivers included in the bundle will work with 3.x which has renamed it to struct.

For backwards compatiblity it should be:

try:
    import struct
except ImportError:
    import ustruct as struct
@jepler
Copy link

jepler commented May 6, 2018

I've grepped around in the circuitpython master branch source tree, its submodules, and Adafruit_CircuitPython_Bundle and its submodules and I didn't find any further problems. There are at least a few which do the reverse of what is suggested, though, such as ports/esp8266/modules/ntptime.py:

try:
    import ustruct as struct
except:
    import struct

@tannewt is there somewhere else I should look, or should I go ahead and close this issue up?

@tannewt
Copy link
Member Author

tannewt commented May 7, 2018

The reverse is fine in ESP8266 modules. I'll close now. Thanks!

@tannewt tannewt closed this as completed May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants