mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03: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
|
|
@ -30,11 +30,10 @@ _symtable_symtable_impl(PyObject *module, PyObject *source,
|
|||
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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue