]> granicus.if.org Git - python/commitdiff
Fix a backwards-compatibility mistake where a new optional argument for
authorBrett Cannon <bcannon@gmail.com>
Fri, 2 May 2008 02:25:09 +0000 (02:25 +0000)
committerBrett Cannon <bcannon@gmail.com>
Fri, 2 May 2008 02:25:09 +0000 (02:25 +0000)
warnings.showwarning() was being used. This broke pre-existing replacements for
the function since they didn't support the extra argument.

Closes issue 2705.

Misc/NEWS
Python/_warnings.c

index 34bdb9dfe91801741fd79cb3982a426b917d51cc..d94d6555cd61b0472605db1635d14a28e280f304 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -40,7 +40,9 @@ Extension Modules
 - 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
 -------
index 88afade15ba753fbeb8c5be23abe33f490dd0b78..8f575ca539db0718a774a56f599a75c4e0ee4725 100644 (file)
@@ -382,9 +382,6 @@ warn_explicit(PyObject *category, PyObject *message,
             
             res = PyObject_CallFunctionObjArgs(show_fxn, message, category,
                                                     filename, lineno_obj,
-                                                    Py_None,
-                                                    sourceline ?
-                                                        sourceline: Py_None,
                                                     NULL);
             Py_DECREF(show_fxn);
             Py_XDECREF(res);