This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tati_alchueyr
Recipients belopolsky, ezio.melotti, flox, georg.brandl, tati_alchueyr
Date 2012-07-20.14:00:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1342792833.39.0.39184693237.issue9914@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2012-07-20 14:00:33tati_alchueyrsetrecipients: + tati_alchueyr, georg.brandl, belopolsky, ezio.melotti, flox
2012-07-20 14:00:33tati_alchueyrsetmessageid: <1342792833.39.0.39184693237.issue9914@psf.upfronthosting.co.za>
2012-07-20 14:00:28tati_alchueyrlinkissue9914 messages
2012-07-20 14:00:27tati_alchueyrcreate