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

Make _usb_ctrl_transfer Python 3 compatible #68

Merged
merged 1 commit into from
Oct 12, 2020
Merged

Make _usb_ctrl_transfer Python 3 compatible #68

merged 1 commit into from
Oct 12, 2020

Conversation

forderud
Copy link
Contributor

@forderud forderud commented Sep 9, 2020

The data_or_wLength argument is of type 'str' in Pyhton 2, whereas it's 'bytes' in Python 3. Calling ord() to convert the character to binary unicode representation is therefore no longer needed on Python 3.

This fixes issue #34 on Python 3 while retaining Python 2 compatibility. Tested locally on Python 2.7 (32bit) and Python 3.7 (64bit).

The data_or_wLength argument is of type 'str' in Pyhton 2, wheras it's 'bytes' in Python 3. Calling ord() to convert the character to binary unicode representation is therefore no longer needed on Python 3.

This fixes issue #34 on Python 3 while retaining Python 2 compatibility
@forderud
Copy link
Contributor Author

@arvydas Would it be possible for you to review this proposal?

@arvydas arvydas merged commit 87d6454 into arvydas:master Oct 12, 2020
@arvydas
Copy link
Owner

arvydas commented Oct 12, 2020

Thank you very much for this fix. Pushing an update to the library in a bit.

@forderud
Copy link
Contributor Author

Thank you very much for this fix. Pushing an update to the library in a bit.

Thanks. I've just submitted a follow-up doc update in #71.

@forderud forderud deleted the py3-fix branch October 12, 2020 07:34
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

Successfully merging this pull request may close these issues.

2 participants