mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-37253: Add _PyCompilerFlags_INIT macro (GH-14018)
Add a new _PyCompilerFlags_INIT macro to initialize PyCompilerFlags variables, rather than initializing cf_flags and cf_feature_version explicitly in each variable.
This commit is contained in:
parent
2c9b498759
commit
37d66d7d4b
8 changed files with 15 additions and 29 deletions
|
@ -4845,7 +4845,6 @@ fstring_compile_expr(const char *expr_start, const char *expr_end,
|
|||
struct compiling *c, const node *n)
|
||||
|
||||
{
|
||||
PyCompilerFlags cf;
|
||||
node *mod_n;
|
||||
mod_ty mod;
|
||||
char *str;
|
||||
|
@ -4887,8 +4886,8 @@ fstring_compile_expr(const char *expr_start, const char *expr_end,
|
|||
str[len+1] = ')';
|
||||
str[len+2] = 0;
|
||||
|
||||
PyCompilerFlags cf = _PyCompilerFlags_INIT;
|
||||
cf.cf_flags = PyCF_ONLY_AST;
|
||||
cf.cf_feature_version = PY_MINOR_VERSION;
|
||||
mod_n = PyParser_SimpleParseStringFlagsFilename(str, "<fstring>",
|
||||
Py_eval_input, 0);
|
||||
if (!mod_n) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue