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

Replace deprecated basestring with str (Py3) #722

Merged
merged 3 commits into from
Apr 3, 2020

Conversation

MmAaXx500
Copy link
Contributor

Description

In Python3 basestring was removed and replaced with str. So I replaced them.

@fabiencastan
Copy link
Member

Thanks for the PR and sorry for the huge latency.
For full compatibility, we can do:

try:
    _ = basestring
except NameError:
    # 'basestring' is undefined, so it must be Python 3
    basestring = (str, bytes)

What do you think?

@MmAaXx500
Copy link
Contributor Author

Yes, you are right!
I will change it shortly.

For full compatibility with py2 basestring.
@fabiencastan
Copy link
Member

We still need to maintain compatibility with python 2.
Could you put the code I proposed at the beginning of the file and continue to use basestring?
This way on python 2 it will find the original basestring and on python 3 basestring will be defined as (str, bytes).

@MmAaXx500
Copy link
Contributor Author

Sorry, I misunderstood what do you mean.
Of course.

@fabiencastan fabiencastan merged commit 887e941 into alicevision:develop Apr 3, 2020
@fabiencastan
Copy link
Member

@MmAaXx500 Thanks for making the PR and not only reporting the issue!

@fabiencastan fabiencastan added this to the 2020.1.0 milestone Apr 3, 2020
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