Commit Graph

22 Commits

Author SHA1 Message Date
Andrew M. Kuchling dc36d7cf85 #6647: add note to two examples 2010-04-02 17:54:26 +00:00
Andrew M. Kuchling d886290464 #6647: document that catch_warnings is not thread-safe 2010-04-02 17:48:23 +00:00
Brett Cannon 6fdd3dcb6a DeprecationWarning is now silent by default.
This was originally suggested by Guido, discussed on the stdlib-sig mailing
list, and given the OK by Guido directly to me. What this change essentially
means is that Python has taken a policy of silencing warnings that are only
of interest to developers by default. This should prevent users from seeing
warnings which are triggered by an application being run against a new
interpreter before the app developer has a chance to update their code.

Closes issue #7319. Thanks to Antoine Pitrou, Ezio Melotti, and Brian Curtin
for helping with the issue.
2010-01-10 02:56:19 +00:00
Georg Brandl f01697014f #6843: add link from filterwarnings to where the meaning of the arguments is covered. 2009-09-05 16:47:17 +00:00
Georg Brandl b4d0ef91a5 #6513: fix example code: warning categories are classes, not instances. 2009-07-18 09:03:10 +00:00
Benjamin Peterson 72f94f75d6 add versionadded 2009-07-12 16:56:54 +00:00
Brett Cannon 6c4cff0f32 Require implementations for warnings.showwarning() support the 'line' argument.
Was a DeprecationWarning for not supporting it since Python 2.6.

Closes issue #3652.
2009-03-11 04:51:06 +00:00
Georg Brandl c62ef8b4d9 Remove trailing whitespace. 2009-01-03 20:55:06 +00:00
Nick Coghlan d2e0938362 Issue #3781: Final cleanup of warnings.catch_warnings and its usage in the test suite. Closes issue w.r.t. 2.6 (R: Brett Cannon) 2008-09-11 12:11:06 +00:00
Brett Cannon 672237dc6c warnings.catch_warnings() now returns a list or None instead of the custom
WarningsRecorder object. This makes the API simpler to use as no special object
must be learned.

Closes issue 3781.
Review by Benjamin Peterson.
2008-09-09 00:49:16 +00:00
Brett Cannon 3dffcd1a72 Make it more obvious that warnings.catch_warnings() and its arguments should be considered keyword-only. 2008-09-05 03:52:59 +00:00
Andrew M. Kuchling 2dd647b8fc typo fix 2008-09-02 01:39:18 +00:00
Brett Cannon 1eaf0742d8 Move test.test_support.catch_warning() to the warnings module, rename it
catch_warnings(), and clean up the API.

While expanding the test suite, a bug was found where a warning about the
'line' argument to showwarning() was not letting functions with '*args' go
without a warning.

Closes issue 3602.
Code review by Benjamin Peterson.
2008-09-02 01:25:16 +00:00
Andrew M. Kuchling 311c580539 Document the 'line' argument 2008-05-10 17:37:05 +00:00
Brett Cannon 8a232cc385 Add a DeprecationWarning for when warnings.showwarning() is set to a function
that lacks support for the new 'line' argument.
2008-05-05 05:32:07 +00:00
Georg Brandl 4aa8df2871 Fix markup. 2008-04-13 07:07:44 +00:00
Brett Cannon e974689038 Re-implement the 'warnings' module in C. This allows for usage of the
'warnings' code in places where it was previously not possible (e.g., the
parser). It could also potentially lead to a speed-up in interpreter start-up
if the C version of the code (_warnings) is imported over the use of the
Python version in key places.

Closes issue #1631171.
2008-04-12 23:44:07 +00:00
Benjamin Peterson 092a1f7ad7 PyErr_Warn is decrepated. Use PyErr_WarnEx 2008-03-31 21:57:13 +00:00
Brett Cannon 338d41850a Use a versionchanged directive. 2007-12-09 05:09:37 +00:00
Georg Brandl 2b92f6bab3 Diverse markup fixes. 2007-12-06 01:52:24 +00:00
Christian Heimes 28104c58d2 Expose Py_Py3kWarningFlag as sys.py3kwarning as discussed in #1504
Also added a warning.warnpy3k() as convenient method for Python 3.x related deprecation warnings.
2007-11-27 23:16:44 +00:00
Georg Brandl 8ec7f65613 Move the 2.6 reST doc tree in place. 2007-08-15 14:28:01 +00:00