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.
(cherry picked from commit 37d66d7d4bc7dbac9809d69966a774ebb32563be)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
diff --git a/Modules/symtablemodule.c b/Modules/symtablemodule.c
index d66cb44..9180f18 100644
--- a/Modules/symtablemodule.c
+++ b/Modules/symtablemodule.c
@@ -30,11 +30,10 @@
struct symtable *st;
PyObject *t;
int start;
- PyCompilerFlags cf;
+ PyCompilerFlags cf = _PyCompilerFlags_INIT;
PyObject *source_copy = NULL;
cf.cf_flags = PyCF_SOURCE_IS_UTF8;
- cf.cf_feature_version = PY_MINOR_VERSION;
const char *str = _Py_SourceAsString(source, "symtable", "string or bytes", &cf, &source_copy);
if (str == NULL) {