summaryrefslogtreecommitdiffstats
path: root/Python/_warnings.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove C++/C99-style comments.Brett Cannon2010-01-151-2/+2
|
* The silencing of DeprecationWarning was not taking -3 into consideration. SinceBrett Cannon2010-01-141-12/+18
| | | | | | | | Py3K warnings are DeprecationWarning by default this was causing -3 to essentially be a no-op. Now DeprecationWarning is only silenced if -3 is not used. Closes issue #7700. Thanks Ezio Melotti and Florent Xicluna for patch help.
* DeprecationWarning is now silent by default.Brett Cannon2010-01-101-20/+23
| | | | | | | | | | | | 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.
* Issue #6415: Fixed warnings.warn sagfault on bad formatted string.Hirokazu Yamamoto2009-07-171-0/+2
|
* Issue 5954, PyFrame_GetLineNumber:Jeffrey Yasskin2009-05-081-1/+1
| | | | | | | | | | | | | | Most uses of PyCode_Addr2Line (http://www.google.com/codesearch?q=PyCode_Addr2Line) are just trying to get the line number of a specified frame, but there's no way to do that directly. Forcing people to go through the code object makes them know more about the guts of the interpreter than they should need. The remaining uses of PyCode_Addr2Line seem to be getting the line from a traceback (for example, http://www.google.com/codesearch/p?hl=en#u_9_nDrchrw/pygame-1.7.1release/src/base.c&q=PyCode_Addr2Line), which is replaced by the tb_lineno field. So we may be able to deprecate PyCode_Addr2Line entirely for external use.
* _warnings was importing itself to get an attribute. That's bad if warnings getsBrett Cannon2009-04-011-16/+30
| | | | | | called in a thread that was spawned by an import itself. Last part to close #1665206.
* Require implementations for warnings.showwarning() support the 'line' argument.Brett Cannon2009-03-111-49/+17
| | | | | | Was a DeprecationWarning for not supporting it since Python 2.6. Closes issue #3652.
* Fixed a couple more C99 comments and one occurence of inline.Christian Heimes2008-10-021-3/+3
|
* Move test.test_support.catch_warning() to the warnings module, rename itBrett Cannon2008-09-021-4/+10
| | | | | | | | | | | 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.
* #3342: In tracebacks, printed source lines were not indented since r62555.Amaury Forgeot d'Arc2008-07-111-2/+2
| | | | #3343: Py_DisplaySourceLine should be a private function. Rename it to _Py_DisplaySourceLine.
* warnings.warn_explicit() did not have the proper TypeErrors in place to preventBrett Cannon2008-06-271-5/+13
| | | | | | | | bus errors or SystemError being raised. As a side effect of fixing this, a bad DECREF that could be triggered when 'message' and 'category' were both None was fixed. Closes issue 3211. Thanks JP Calderone for the bug report.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-28/+28
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* turn PyErr_WarnPy3k into a macroBenjamin Peterson2008-05-261-9/+0
|
* Renamed PyString to PyBytesChristian Heimes2008-05-261-28/+28
|
* Fix a refleak in the _warnings module.Georg Brandl2008-05-131-1/+3
|
* Fix logic error in Python/_warnings.c and add a test to verifyBenjamin Peterson2008-05-061-0/+2
|
* Fix a bug in the handling of the stacklevel argument in warnings.warn() whereBrett Cannon2008-05-061-3/+1
| | | | the stack was being unwound by two levels instead of one each time.
* Add a DeprecationWarning for when warnings.showwarning() is set to a functionBrett Cannon2008-05-051-13/+43
| | | | that lacks support for the new 'line' argument.
* Fix the C implementation of 'warnings' to infer the filename of the module thatBrett Cannon2008-05-031-0/+13
| | | | | | | raised an exception properly when __file__ is not set, __name__ == '__main__', and sys.argv[0] is a false value. Closes issue2743.
* Fix some indentation errors.Brett Cannon2008-05-031-9/+10
|
* Fix a backwards-compatibility mistake where a new optional argument forBrett Cannon2008-05-021-3/+0
| | | | | | | warnings.showwarning() was being used. This broke pre-existing replacements for the function since they didn't support the extra argument. Closes issue 2705.
* Added PyErr_WarnPy3k function. (issue 2671) I will be converting current ↵Benjamin Peterson2008-04-271-0/+9
| | | | Py3k warnings to the use of this function soon.
* Correct a refleak found by "regrtest.py -R:: test_structmembers"Amaury Forgeot d'Arc2008-04-141-5/+6
| | | | | | Some other minor updates in _warnings.c: - make a function static - rename a shadowing local variable
* Use PyString_InternFromString instead of PyString_FromString for static varsChristian Heimes2008-04-131-3/+3
|
* Re-implement the 'warnings' module in C. This allows for usage of theBrett Cannon2008-04-121-0/+856
'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.