diff options
author | Brett Cannon <brett@python.org> | 2015-04-13 18:21:02 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2015-04-13 18:21:02 (GMT) |
commit | f299abdafa0f2b6eb7abae274861b19b361c96bc (patch) | |
tree | afc3a2bf560e30c7725510eda3b57d71ceddba00 /Python/pythonrun.c | |
parent | a63cc212348e276c8ede32773313c60ff7fda651 (diff) | |
download | cpython-f299abdafa0f2b6eb7abae274861b19b361c96bc.zip cpython-f299abdafa0f2b6eb7abae274861b19b361c96bc.tar.gz cpython-f299abdafa0f2b6eb7abae274861b19b361c96bc.tar.bz2 |
Issue #23731: Implement PEP 488.
The concept of .pyo files no longer exists. Now .pyc files have an
optional `opt-` tag which specifies if any extra optimizations beyond
the peepholer were applied.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index a8bd024..952316e 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -265,7 +265,7 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename_str, PyCompilerFlags *f static int maybe_pyc_file(FILE *fp, const char* filename, const char* ext, int closeit) { - if (strcmp(ext, ".pyc") == 0 || strcmp(ext, ".pyo") == 0) + if (strcmp(ext, ".pyc") == 0) return 1; /* Only look into the file if we are allowed to close it, since @@ -371,9 +371,6 @@ PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit, fprintf(stderr, "python: Can't reopen .pyc file\n"); goto done; } - /* Turn on optimization if a .pyo file is given */ - if (strcmp(ext, ".pyo") == 0) - Py_OptimizeFlag = 1; if (set_main_loader(d, filename, "SourcelessFileLoader") < 0) { fprintf(stderr, "python: failed to set __main__.__loader__\n"); |