Message162807
| Author |
Ronan.Lamy |
| Recipients |
Ronan.Lamy, docs@python, eric.araujo, eric.snow, lebigot, mherrmann.at, r.david.murray, terry.reedy, vstinner |
| Date |
2012年06月14日.16:53:26 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1339692807.98.0.723832131002.issue12982@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|