Message162807
Doing it at the interpreter level is trivial (cf. patch), except for an annoying bug I noticed (see below). Doing it from user code might require some care to avoid disrupting existing import hooks, but AFAICT something like sys.path_hooks.append(FileFinder.path_hook(['.pyo', SourcelessFileLoader, True])) is supposed to work.
The bug is that -O has currently no effect on sourceless imports: it seems that frozen_importlib actually uses freeze-time __debug__ instead of the current interpreter's. |
|
Date |
User |
Action |
Args |
2012-06-14 16:53:28 | Ronan.Lamy | set | recipients:
+ Ronan.Lamy, terry.reedy, vstinner, lebigot, eric.araujo, r.david.murray, docs@python, eric.snow, mherrmann.at |
2012-06-14 16:53:27 | Ronan.Lamy | set | messageid: <1339692807.98.0.723832131002.issue12982@psf.upfronthosting.co.za> |
2012-06-14 16:53:27 | Ronan.Lamy | link | issue12982 messages |
2012-06-14 16:53:27 | Ronan.Lamy | create | |
|