Tatiana Al-Chueyr <tatiana.alchu...@gmail.com> added the comment: Yesterday I've studied this problem with flavio.ribeiro, and we've started "solving" it. The result of our progress is available at: issue5758_trace_execute_other_modules_main_v0.patch
The problem of our approach is that any code outside the condition "if __name__ == '__main__'" will be run twice, as we used imp.load_source to obtain trace's analyzed code and redefine sys.modules['__main__']. In order to provide a better solution, we were considering using lazy module import, e.g: http://code.activestate.com/recipes/473888-lazy-module-imports/ Any thoughts on this? ---------- keywords: +patch nosy: +tati_alchueyr Added file: http://bugs.python.org/file26451/issue5758_trace_execute_other_modules_main_v0.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9914> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com