bpo-2506: Add -X noopt command line option by vstinner · Pull Request #13600 · python/cpython
vstinner
changed the title
bpo-2506: Add -X noopt command line option
[WIP] bpo-2506: Add -X noopt command line option
vstinner
changed the title
[WIP] bpo-2506: Add -X noopt command line option
bpo-2506: Add -X noopt command line option
Add -X noopt command line option to disable compiler optimizations. distutils ignores noopt: always enable compiler optimizations. * Add sys.flags.noopt flag. * Add 'noopt' keyword-only parameter to builtin compile(), importlib.util.cache_from_source() and py_compile.compile(). * importlib: SourceLoader gets an additional keyword-only '_noopt' parameter. It is used by py_compile.compile(). * importlib uses ``.noopt.pyc`` suffix for .pyc files if sys.flags.noopt is true. * Add PyConfig.optimize parameter. * compiler: rename c_optimize to c_optimization_level, add c_optimize. * Update subprocess._optim_args_from_interpreter_flags(). * Add support.requires_compiler_optimizations() * Update unit tests which rely on compiler optimizations for noopt: add @support.requires_compiler_optimizations. * Add _PyAST_Compile() and _Py_CompileString() private functions: they have an additional 'noopt' parameter. * Set _Py_CONFIG_VERSION to 2 Co-Authored-By: Yury Selivanov <yury@magic.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters