diff options
author | Victor Stinner <vstinner@python.org> | 2021-09-02 11:46:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-02 11:46:47 +0200 |
commit | d589a7e7eb56196c05337d37417479375878b127 (patch) | |
tree | 3d78ca6fbd0b5e51a83509f911b53ae0b481aea8 | |
parent | 679cb4781ea370c3b3ce40d3334dc404d7e9d92b (diff) | |
download | cpython-git-d589a7e7eb56196c05337d37417479375878b127.tar.gz |
bpo-40360: Deprecate the lib2to3 package (GH-28116)
-rw-r--r-- | Doc/whatsnew/3.11.rst | 3 | ||||
-rw-r--r-- | Lib/lib2to3/__init__.py | 2 | ||||
-rw-r--r-- | Lib/test/test_lib2to3.py | 2 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Library/2021-09-02-00-18-32.bpo-40360.9nmMtB.rst | 3 |
4 files changed, 8 insertions, 2 deletions
diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 1b736c71c2..8f0f6f83c0 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -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 diff --git a/Lib/lib2to3/__init__.py b/Lib/lib2to3/__init__.py index 4224dffef4..177405c809 100644 --- a/Lib/lib2to3/__init__.py +++ b/Lib/lib2to3/__init__.py @@ -3,6 +3,6 @@ import warnings warnings.warn( "lib2to3 package is deprecated and may not be able to parse Python 3.10+", - PendingDeprecationWarning, + DeprecationWarning, stacklevel=2, ) diff --git a/Lib/test/test_lib2to3.py b/Lib/test/test_lib2to3.py index fd12a7e7ac..6ea8aa4a56 100644 --- a/Lib/test/test_lib2to3.py +++ b/Lib/test/test_lib2to3.py @@ -2,7 +2,7 @@ import unittest 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__': diff --git a/Misc/NEWS.d/next/Library/2021-09-02-00-18-32.bpo-40360.9nmMtB.rst b/Misc/NEWS.d/next/Library/2021-09-02-00-18-32.bpo-40360.9nmMtB.rst new file mode 100644 index 0000000000..4e9422dc06 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-09-02-00-18-32.bpo-40360.9nmMtB.rst @@ -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. |