diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2019-06-13 00:36:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-13 00:36:03 (GMT) |
commit | 92e836c7dcaf74f7b8617250414224d24d1eb1f2 (patch) | |
tree | 7744c1464030566c890df9b5fba0d1f6282f0ac8 /Python/compile.c | |
parent | c15a682603a47f5aef5025f6a2e3babb699273d6 (diff) | |
download | cpython-92e836c7dcaf74f7b8617250414224d24d1eb1f2.zip cpython-92e836c7dcaf74f7b8617250414224d24d1eb1f2.tar.gz cpython-92e836c7dcaf74f7b8617250414224d24d1eb1f2.tar.bz2 |
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>
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Python/compile.c b/Python/compile.c index 9e4a209..4d3ecfe 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -309,7 +309,7 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, { struct compiler c; PyCodeObject *co = NULL; - PyCompilerFlags local_flags; + PyCompilerFlags local_flags = _PyCompilerFlags_INIT; int merged; PyConfig *config = &_PyInterpreterState_GET_UNSAFE()->config; @@ -332,8 +332,6 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, if (c.c_future == NULL) goto finally; if (!flags) { - local_flags.cf_flags = 0; - local_flags.cf_feature_version = PY_MINOR_VERSION; flags = &local_flags; } merged = c.c_future->ff_features | flags->cf_flags; |