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 ncoghlan
Recipients belopolsky, ezio.melotti, flox, georg.brandl, ncoghlan, tati_alchueyr
Date 2012-07-26.08:09:03
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343290144.2.0.715032080327.issue9914@psf.upfronthosting.co.za>
In-reply-to
Content
This is a tricky one. Long term, the right approach is to migrate all the "scripts that run other scripts" over to runpy, but the runpy API needs work before we can do that (see #9325).

For bug fix purposes though, these modules can borrow some of runpy's infrastructure in order to fake the system state correctly. Specifically, the runpy._TempModule and runpy._ModifiedArgv0 context managers. (_TempModule may need a tweak to allow the module to be used to be passed in rather than always being implicitly created)

See runpy._run_module_code for an example of how to use them.
History
Date User Action Args
2012-07-26 08:09:04ncoghlansetrecipients: + ncoghlan, georg.brandl, belopolsky, ezio.melotti, flox, tati_alchueyr
2012-07-26 08:09:04ncoghlansetmessageid: <1343290144.2.0.715032080327.issue9914@psf.upfronthosting.co.za>
2012-07-26 08:09:03ncoghlanlinkissue9914 messages
2012-07-26 08:09:03ncoghlancreate