Skip to content

Fix for Python 4: use >= 3 instead of == 3 #1485

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

Closed
wants to merge 2 commits into from
Closed

Conversation

hugovk
Copy link
Contributor

@hugovk hugovk commented Jan 9, 2020

  • wrote descriptive pull request text
  • [n/a] added/updated test(s)
  • [n/a] updated/extended the documentation
  • [n/a] added news fragment in docs/changelog folder

We don't yet know if 3.10 or 4.0 will follow Python 3.9, but whichever it is, it will probably happen in 2020 when Python 3.9 reaches beta.

When run on Python 4, this line would be skipped:

    if sys.version_info[0] == 3:
        enablerlcompleter()	

Instead:

    if sys.version_info[0] >= 3:
        enablerlcompleter()	

Found using https://github.com/asottile/flake8-2020.

@gaborbernat
Copy link
Contributor

gaborbernat commented Jan 9, 2020

We do, see https://www.python.org/dev/peps/pep-0596/#id6. Either way, we don't know if python 4 (if ever released) will be python 3 compatible, so what we have now is the correct thing to do.

After the release of 3.10.0 final, a final 3.9 bugfix update will be released.

@gaborbernat gaborbernat closed this Jan 9, 2020
@hugovk
Copy link
Contributor Author

hugovk commented Jan 9, 2020

Still a draft, but that 3.9 release PEP looks fairly definitive. Some PEPs refer to 3.10, others to 4, so it's not entirely clear.

I also found this, and the consensus is towards 3.10:

Anyway, thanks!

@gaborbernat
Copy link
Contributor

@hugovk side-note that we'll be soon dropping the master branch as a whole, and promoting the rewrite branch from #1366 (see https://github.com/pypa/virtualenv/milestone/7) - so would this need be fixed most likely would be on that branch either way

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