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 flox
Recipients ezio.melotti, flox
Date 2010-02-03.20:02:29
SpamBayes Score 3.537076e-05
Marked as misclassified No
Message-id <1265227352.4.0.15322999222.issue7849@psf.upfronthosting.co.za>
In-reply-to
Content
Currently this context manager is used in 3 different situations:
 - to silence standard warnings
 - to record warnings in a list, in order to verify them
 - to silence py3k warnings

But it does not accept any parameter, and it does not *check* if the filter is obsolete. It silence *all* warnings, blindly.

I would like to propose an enhancement of this function, which accepts a list of filters as parameters, and which verifies that there's really something to catch.
An optional boolean argument "lazy" can be used to disable the check.
  check_warnings([filter[, ...[, lazy=False]]])

Additionnally, a sister function will filter only the py3k warnings:
  check_py3k_warnings([filter[, ...[, lazy=False]]])

See the patch and its docstring for details.

Note: this context manager could be used to fix the last part of #7092
History
Date User Action Args
2010-02-03 20:02:32floxsetrecipients: + flox, ezio.melotti
2010-02-03 20:02:32floxsetmessageid: <1265227352.4.0.15322999222.issue7849@psf.upfronthosting.co.za>
2010-02-03 20:02:30floxlinkissue7849 messages
2010-02-03 20:02:29floxcreate