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 zseil
Recipients
Date 2007-04-02.08:41:14
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
I don't know how desireable this feature is, but
I think that a better solution would be to add
a new parameter to warnings.warn(), instead of
reusing the old one.

Also, your description is wrong; when warn() in
your example is called with stacklevel -2, the
reported frame is m2.m21.f().  To get your result,
you have to call warn() with stacklevel -1.

I think that a better solution would be to add
a skipmodules='moduleprefix' parameter to the
warn() function.  warn() would then simply look
for the first frame whose module name doesn't
start with this prefix.
 
History
Date User Action Args
2007-08-23 15:30:00adminlinkissue850482 messages
2007-08-23 15:30:00admincreate