[Python-checkins] r62626 - in python/trunk: Misc/NEWS Python/_warnings.c

brett.cannon python-checkins at python.org
Fri May 2 04:25:09 CEST 2008


Author: brett.cannon
Date: Fri May  2 04:25:09 2008
New Revision: 62626

Log:
Fix a backwards-compatibility mistake where a new optional argument for
warnings.showwarning() was being used. This broke pre-existing replacements for
the function since they didn't support the extra argument.

Closes issue 2705.


Modified:
   python/trunk/Misc/NEWS
   python/trunk/Python/_warnings.c

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Fri May  2 04:25:09 2008
@@ -40,7 +40,9 @@
 - Issue #1631171: Re-implement the 'warnings' module in C (the original Python
   code has been kept as backup). This will allow for using the 'warning's
   machinery in such places as the parser where use of pure Python code is not
-  possible.
+  possible.  Both the ``showarning()`` and ``formatwarning()`` gain an
+  optional 'line' argument which is not called by default for
+  backwards-compatibility reasons.
 
 Library
 -------

Modified: python/trunk/Python/_warnings.c
==============================================================================
--- python/trunk/Python/_warnings.c	(original)
+++ python/trunk/Python/_warnings.c	Fri May  2 04:25:09 2008
@@ -382,9 +382,6 @@
             
             res = PyObject_CallFunctionObjArgs(show_fxn, message, category,
                                                     filename, lineno_obj,
-                                                    Py_None,
-                                                    sourceline ?
-                                                        sourceline: Py_None,
                                                     NULL);
             Py_DECREF(show_fxn);
             Py_XDECREF(res);


More information about the Python-checkins mailing list