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 serhiy.storchaka
Recipients Arfrever, barry, berker.peksag, brett.cannon, eric.snow, jwilk, larry, ncoghlan, njs, serhiy.storchaka, takluyver
Date 2015-08-14.19:24:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1439580271.57.0.0128153483092.issue24305@psf.upfronthosting.co.za>
In-reply-to
Content
Frames can be skipped only for warnings issued by imported module code, not for warnings issued by import machinery itself.

I propose following algorithm:

Before executing module code push the current frame and the number of frames to skip in global stack in the warnings module, and pop it after execution (public context manager can help). In warnings.warn() skip stacklevel frames and if saved frame was skipped, skip corresponding additional number of frames. Repeat for all saved frames.
History
Date User Action Args
2015-08-14 19:24:31serhiy.storchakasetrecipients: + serhiy.storchaka, barry, brett.cannon, ncoghlan, larry, jwilk, Arfrever, njs, eric.snow, takluyver, berker.peksag
2015-08-14 19:24:31serhiy.storchakasetmessageid: <1439580271.57.0.0128153483092.issue24305@psf.upfronthosting.co.za>
2015-08-14 19:24:31serhiy.storchakalinkissue24305 messages
2015-08-14 19:24:31serhiy.storchakacreate