Éric Araujo <mer...@netwok.org> added the comment: (For the reference, the bug I added is this: http://hg.python.org/cpython/rev/c10946a17420#l6.45
p7g.util.byte_compile calls py_compile.compile with a filename ending in .pyc or .pyo as appropriate, but the optimization level in the py_compile.compile function depends on the calling Python’s -O option. When byte_compile wants to create a .pyo file but is run under a python without -O, it spawns a subprocess with the -O option. The fix I did made sure that the filename used (pyc or pyo) did not depend on the calling Python’s -O, *but* it should not have removed the setting of -O/-OO in the subprocess, as it’s the only way to control the optimization level in py_compile.compile before 3.2. I think I will use a py_compile or compileall function so that I can have control over the optimization level from Python, which will let me remove the inelegant spawning in byte_compile, and I will backport that function for distutils2. If this makes no sense, please ignore. I’m not sure I would have understood what I’m talking about a year ago.) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13473> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com