-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix USB tests working with python 3 #11520
Conversation
@fkjagodzinski could you have a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OPpuolitaival did you have any problems with these lines? I run usb tests on latest master d0b5ba6 with Python3 and these did not cause problems. I had to update other lines though -- fkjagodzinski@96581ff. Feel free to cherry-pick this patch here.
@@ -647,7 +647,7 @@ def get_descriptor_test(dev, vendor_id, product_id, log): | |||
# device descriptor | |||
try: | |||
ret = get_descriptor(dev, (DESC_TYPE_DEVICE << 8) | (0 << 0), 0, DEVICE_DESC_SIZE) | |||
dev_desc = dict(zip(device_descriptor_keys, device_descriptor_parser.unpack(ret))) | |||
dev_desc = dict(list(zip(device_descriptor_keys, device_descriptor_parser.unpack(ret)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to make a list here. dict()
can handle generators just fine.
@@ -194,7 +194,7 @@ def send_data_sequence(self, chunk_size=1): | |||
return | |||
mbed_serial.reset_output_buffer() | |||
mbed_serial.dtr = True | |||
for byteval in itertools.chain(reversed(range(0x100)), range(0x100)): | |||
for byteval in itertools.chain(reversed(list(range(0x100))), list(range(0x100))): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add list()
here.
I tried to verify these changes on MAC - usb tests still FAILED... |
On Windows I saw the same errors... |
I did use 2to3 for these changes.. that normally find out problems quite well |
Yeah, the changes seem reasonable in general as they cover tha API changes (generators returned instead of objects). In this particular case these changes are unnecessary. |
Cannot test with Mac. I ask my colleague to test this on Windows |
Description
Fix USB related host_test python scripts to work on python 3 also
Pull request type
Reviewers
@jussisip could you test this?
Release Notes