Message300711
| Author |
vaultah |
| Recipients |
Arfrever, brett.cannon, eric.snow, ezio.melotti, mattheww, ncoghlan, vaultah |
| Date |
2017年08月22日.16:43:55 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1503420236.05.0.892660993519.issue16217@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
In order to load and compile the module code, runpy calls the loader's get_code method. Because that happens outside of the normal import process, and PyImport_ImportModuleLevelObject is currently the only place where remove_importlib_frames is being invoked, tracebacks of exceptions occurring in get_code are kept unmodified.
Would it be wrong to drop all importlib frames from all unhandled exceptions, except when the -v flag is present? On the other hand, since the patch from #issue15486 seems to work fine in most scenarios, I propose removing both runpy and importlib traceback entries locally inside the runpy module. There may be better solutions, though...
In any case, I'm willing to write a patch. |
|