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

Remove lib2to3 #2311

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Remove lib2to3 #2311

wants to merge 4 commits into from

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Jul 22, 2024

lib2to3 is no longer provided with Python 3.13: https://peps.python.org/pep-0594/#deprecated-modules But it's also redundant here.

See the following test:
python -c "from setuptestframework import makeadopackage; makeadopackage('test_folder')":
Before: with_2_to_3.zip
This PR: plain.zip

The only changes are:

  • Naive addition of extra parentheses around print arguments
  • lib2to3 actually breaks annotations by removing from __future__ import annotations
  • dict.items() is redundantly wrapped in a list (probably to avoid issues with single-use iterators)
  • Redundant type tuple in isinstance is simplified (good catch lib2to3, I've added this source code cleanup to adodbapi: Cleanup obsolete and unsupported python code #2094 )

Additionally, I changed os.mkdir to os.makedirs (which creates folders recursively) so that you don't have to manually create the test folder first (it would still fail if it already exists)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant