From 1def7754b7a41fe57efafaf5eff24cfa15353444 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 23 Apr 2020 03:03:24 +0200 Subject: 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 --- Python/pythonrun.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Python/pythonrun.c') diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 6199f0c661..e3fd3b2427 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -185,7 +185,7 @@ PyRun_InteractiveOneObjectEx(FILE *fp, PyObject *filename, PyArena *arena; const char *ps1 = "", *ps2 = "", *enc = NULL; int errcode = 0; - int use_peg = _PyInterpreterState_GET()->config.use_peg; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; _Py_IDENTIFIER(encoding); _Py_IDENTIFIER(__main__); @@ -1030,7 +1030,7 @@ PyRun_StringFlags(const char *str, int start, PyObject *globals, mod_ty mod; PyArena *arena; PyObject *filename; - int use_peg = _PyInterpreterState_GET()->config.use_peg; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; filename = _PyUnicode_FromId(&PyId_string); /* borrowed */ if (filename == NULL) @@ -1061,7 +1061,7 @@ PyRun_FileExFlags(FILE *fp, const char *filename_str, int start, PyObject *globa mod_ty mod; PyArena *arena = NULL; PyObject *filename; - int use_peg = _PyInterpreterState_GET()->config.use_peg; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; filename = PyUnicode_DecodeFSDefault(filename_str); if (filename == NULL) @@ -1222,7 +1222,7 @@ Py_CompileStringObject(const char *str, PyObject *filename, int start, { PyCodeObject *co; mod_ty mod; - int use_peg = _PyInterpreterState_GET()->config.use_peg; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; PyArena *arena = PyArena_New(); if (arena == NULL) return NULL; @@ -1329,7 +1329,7 @@ _Py_SymtableStringObjectFlags(const char *str, PyObject *filename, int start, Py { struct symtable *st; mod_ty mod; - int use_peg = _PyInterpreterState_GET()->config.use_peg; + int use_peg = _PyInterpreterState_GET()->config._use_peg_parser; PyArena *arena; arena = PyArena_New(); -- cgit v1.2.1