bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)
* Rename PyConfig.use_peg to _use_peg_parser
* Document PyConfig._use_peg_parser and mark it a deprecated
* Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated
in the documentation.
* Add use_old_parser() and skip_if_new_parser() to test.support
* Remove sys.flags.use_peg: use_old_parser() uses
_testinternalcapi.get_configs() instead.
* Enhance test_embed tests
* subprocess._args_from_interpreter_flags() copies -X oldparser
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index a815436..b091195 100644
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -427,7 +427,7 @@
* ``-X faulthandler`` to enable :mod:`faulthandler`;
* ``-X oldparser``: enable the traditional LL(1) parser. See also
- :envvar:`PYTHONOLDPARSER`.
+ :envvar:`PYTHONOLDPARSER` and :pep:`617`.
* ``-X showrefcount`` to output the total reference count and number of used
memory blocks when the program finishes or after each statement in the
interactive interpreter. This only works on debug builds.
@@ -480,6 +480,9 @@
The ``-X showalloccount`` option has been removed.
+ .. deprecated-removed:: 3.9 3.10
+ The ``-X oldparser`` option.
+
Options you shouldn't use
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -578,8 +581,11 @@
.. envvar:: PYTHONOLDPARSER
- If this is set it is equivalent to specifying the :option:`-X`
- ``oldparser`` option.
+ If this is set to a non-empty string, enable the traditional LL(1) parser.
+
+ See also the :option:`-X` ``oldparser`` option and :pep:`617`.
+
+ .. deprecated-removed:: 3.9 3.10
.. envvar:: PYTHONINSPECT