Message166466
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. |
|
Date |
User |
Action |
Args |
2012-07-26 08:09:04 | ncoghlan | set | recipients:
+ ncoghlan, georg.brandl, belopolsky, ezio.melotti, flox, tati_alchueyr |
2012-07-26 08:09:04 | ncoghlan | set | messageid: <1343290144.2.0.715032080327.issue9914@psf.upfronthosting.co.za> |
2012-07-26 08:09:03 | ncoghlan | link | issue9914 messages |
2012-07-26 08:09:03 | ncoghlan | create | |
|