-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[barefoot][platform] platform API 2.0 fixes #6607
Conversation
Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
try: | ||
_str_type = basestring | ||
except NameError: | ||
_str_type = str |
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.
All applications which import sonic-platform should now use the Python 3 API if it is available (as of a couple weeks ago). Therefore, you should be able stop building/installing a Python 2 sonic-platform package and you could then remove this check, as the string type will always be str
with Python 3.
If you'd prefer to keep this for now and leave the remove of removal of Python 2 support for a separate PR, that's OK. Just let me know.
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.
ok, I will prepare a separate PR for this.
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.
Sure thing. I just wanted to prevent you from adding code if not necessary. We can merge this as-is and you can clean it up with the subsequent PR, once you're able to prove you no longer need to build/install a Python 2 package.
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.
Thanks for info!
@jleveque please backport to 202012 |
To improve python3 support of berefoot's sonic_platform Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
To improve python3 support of berefoot's sonic_platform Signed-off-by: Volodymyr Boyko <volodymyrx.boiko@intel.com>
Signed-off-by: Volodymyr Boyko volodymyrx.boiko@intel.com
- Why I did it
To improve python3 support of berefoot's sonic_platform
- How I did it
- How to verify it
- Which release branch to backport (provide reason below if selected)
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)