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

Python3 fixes #11231

Merged
merged 1 commit into from
Aug 15, 2019
Merged

Python3 fixes #11231

merged 1 commit into from
Aug 15, 2019

Conversation

OPpuolitaival
Copy link
Contributor

Description

Fix some python scripts to work with python 3.x

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

Release Notes

@mbed-ci
Copy link

mbed-ci commented Aug 15, 2019

Test run: FAILED

Summary: 1 of 4 test jobs failed
Build number : 2
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_unittests

@ciarmcom ciarmcom requested review from a team August 15, 2019 09:00
@ciarmcom
Copy link
Member

@OPpuolitaival, thank you for your changes.
@ARMmbed/mbed-os-tools @ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@adbridge adbridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not yet familiar with python3 syntax but as far as I can tell this looks ok

@@ -331,7 +331,7 @@ def is_target_supported(cls, target_name):

@classmethod
def all_supported_targets(cls):
return [t for t in TARGET_MAP.keys() if cls.is_target_supported(t)]
return [t for t in list(TARGET_MAP) if cls.is_target_supported(t)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this still be list(TARGET_MAP.keys()) for python2 compatibility?

Just wondering if that works still the same.

Copy link
Contributor Author

@OPpuolitaival OPpuolitaival Aug 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@teetak01 "list(TARGET_MAP.keys())" and "list(TARGET_MAP)" output is excatly same in both python versions 3.x and 2.7.x

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reference if you want to read: https://python-future.org/compatible_idioms.html

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to fine. Also tested myself a bit between those.

@mbed-ci
Copy link

mbed-ci commented Aug 15, 2019

Test run: SUCCESS

Summary: 11 of 11 test jobs passed
Build number : 3
Build artifacts

@adbridge adbridge merged commit 0056d8e into ARMmbed:master Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants