diff options
author | INADA Naoki <methane@users.noreply.github.com> | 2017-12-14 07:47:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-14 07:47:20 (GMT) |
commit | 7ea143ae795a9fd57eaccf490d316bdc13ee9065 (patch) | |
tree | 1276bfc657c9a9281c6152ed656a89abdaaff4b8 /Python/compile.c | |
parent | b5fd9ad05e0f15f8272b8f1b829af22077230584 (diff) | |
download | cpython-7ea143ae795a9fd57eaccf490d316bdc13ee9065.zip cpython-7ea143ae795a9fd57eaccf490d316bdc13ee9065.tar.gz cpython-7ea143ae795a9fd57eaccf490d316bdc13ee9065.tar.bz2 |
bpo-29469: Move constant folding to AST optimizer (GH-2858)
Diffstat (limited to 'Python/compile.c')
-rw-r--r-- | Python/compile.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c index a3fcd53..3fd8491 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -331,6 +331,10 @@ PyAST_CompileObject(mod_ty mod, PyObject *filename, PyCompilerFlags *flags, c.c_optimize = (optimize == -1) ? Py_OptimizeFlag : optimize; c.c_nestlevel = 0; + if (!_PyAST_Optimize(mod, arena)) { + goto finally; + } + c.c_st = PySymtable_BuildObject(mod, filename, c.c_future); if (c.c_st == NULL) { if (!PyErr_Occurred()) |