-
Notifications
You must be signed in to change notification settings - Fork 199
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
SG-29997 - FIRST PHASE Python2 removing #352
SG-29997 - FIRST PHASE Python2 removing #352
Conversation
eduardoChaucaGallegos
commented
Jul 11, 2024
- ensure_* functions replaced by function from sgutils.py.
- six types replaced by native
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.
I see that you are adding the "ensure_" functions to a module but I don't see them being removed from the six module. Should not we do it?
shotgun_api3/lib/sgutils.py
Outdated
raise TypeError(f"not expecting type '{type(s)}'") | ||
if isinstance(s, bytes): | ||
s = s.decode(encoding, errors) | ||
return s |
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.
Minor: the two functions don't use the same condition logic.
if isinstance(s, str):
return s
elif isinstance(s, bytes):
return s.decode(encoding, errors)
raise TypeError(f"not expecting type '{type(s)}'")
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.
LGTM
Just a little reminder here, even if it's already merged; most of the work has already been done months ago |
@mathbou Thanks for your collaboration, we have considered your changes for this PR. We did a new PR because we are trying to take less risk and doing this python2 removal in phases. |