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 <>
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.
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: <>
2015-08-14 19:24:31serhiy.storchakalinkissue24305 messages
2015-08-14 19:24:31serhiy.storchakacreate