Mercurial > cpython-lru_cache-weakref
diff Modules/_struct.c @ 60392:f1ea03e37ff6 2.6
Fix incorrect stacklevel for struct warnings. (Partial backport of r78690).
| author | Mark Dickinson <dickinsm@gmail.com> |
|---|---|
| date | Tue, 06 Apr 2010 15:19:40 +0000 |
| parents | 9ed8991a9141 |
| children | e38335d4df91 |
line wrap: on
line diff
--- a/Modules/_struct.c Tue Apr 06 14:43:22 2010 +0000 +++ b/Modules/_struct.c Tue Apr 06 15:19:40 2010 +0000 @@ -160,7 +160,7 @@ PyObject *o; int res; PyErr_Clear(); - if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) + if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 1) < 0) return -1; o = PyNumber_Int(v); if (o == NULL) @@ -269,7 +269,7 @@ PyObject *o; int res; PyErr_Clear(); - if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) + if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 1) < 0) return -1; o = PyNumber_Int(v); if (o == NULL) @@ -279,7 +279,7 @@ return res; } #endif - if (PyErr_WarnEx(PyExc_DeprecationWarning, INT_OVERFLOW, 2) < 0) + if (PyErr_WarnEx(PyExc_DeprecationWarning, INT_OVERFLOW, 1) < 0) return -1; wrapped = PyNumber_And(v, pylong_ulong_mask); if (wrapped == NULL) @@ -308,7 +308,7 @@ PyObject *o; int res; PyErr_Clear(); - if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2) < 0) + if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 1) < 0) return -1; o = PyNumber_Int(v); if (o == NULL) @@ -321,7 +321,7 @@ wrapped = PyNumber_And(v, pylong_ulong_mask); if (wrapped == NULL) return -1; - if (PyErr_WarnEx(PyExc_DeprecationWarning, INT_OVERFLOW, 2) < 0) { + if (PyErr_WarnEx(PyExc_DeprecationWarning, INT_OVERFLOW, 1) < 0) { Py_DECREF(wrapped); return -1; } @@ -417,7 +417,7 @@ if (msg == NULL) return -1; rval = PyErr_WarnEx(PyExc_DeprecationWarning, - PyString_AS_STRING(msg), 2); + PyString_AS_STRING(msg), 1); Py_DECREF(msg); if (rval == 0) return 0;
