Skip to content

bpo-40360: Deprecate the lib2to3 package #28116

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

Merged
merged 1 commit into from
Sep 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Doc/whatsnew/3.11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,9 @@ Build Changes
Deprecated
==========

* The :mod:`lib2to3` package is now deprecated and may not be able to parse
Python 3.10 or newer. See the :pep:`617` (New PEG parser for CPython).
(Contributed by Victor Stinner in :issue:`40360`.)


Removed
Expand Down
2 changes: 1 addition & 1 deletion Lib/lib2to3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

warnings.warn(
"lib2to3 package is deprecated and may not be able to parse Python 3.10+",
PendingDeprecationWarning,
DeprecationWarning,
stacklevel=2,
)
2 changes: 1 addition & 1 deletion Lib/test/test_lib2to3.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from test.support.import_helper import import_fresh_module
from test.support.warnings_helper import check_warnings

with check_warnings(("", PendingDeprecationWarning)):
with check_warnings(("", DeprecationWarning)):
load_tests = import_fresh_module('lib2to3.tests', fresh=['lib2to3']).load_tests

if __name__ == '__main__':
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The :mod:`lib2to3` package is now deprecated and may not be able to parse
Python 3.10 or newer. See the :pep:`617` (New PEG parser for CPython). Patch
by Victor Stinner.