Skip to content

Remove lib2to3#2311

Merged
mhammond merged 4 commits intomhammond:mainfrom
Avasam:remove-lib2to3
Oct 4, 2024
Merged

Remove lib2to3#2311
mhammond merged 4 commits intomhammond:mainfrom
Avasam:remove-lib2to3

Conversation

@Avasam
Copy link
Copy Markdown
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)

@Avasam Avasam requested a review from vernondcole July 22, 2024 21:07
@mhammond mhammond merged commit 2f4b1dd into mhammond:main Oct 4, 2024
@Avasam Avasam deleted the remove-lib2to3 branch October 4, 2024 17:00
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.

2 participants