summaryrefslogtreecommitdiffstats
path: root/Modules/_struct.c
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-04-06 15:19:40 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-04-06 15:19:40 (GMT)
commite9a5a549e41fee42bdcab34024d52fdf0620948c (patch)
tree7ea8db1fc82e9c7d9054b02a0184492f468623ae /Modules/_struct.c
parentf6224e799c69220ba06c3fde9c300a23fab3f2ce (diff)
downloadcpython-e9a5a549e41fee42bdcab34024d52fdf0620948c.zip
cpython-e9a5a549e41fee42bdcab34024d52fdf0620948c.tar.gz
cpython-e9a5a549e41fee42bdcab34024d52fdf0620948c.tar.bz2
Fix incorrect stacklevel for struct warnings. (Partial backport of r78690).
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r--Modules/_struct.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index ff1aca2..d924cad 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -160,7 +160,7 @@ get_long(PyObject *v, long *p)
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 @@ get_wrapped_long(PyObject *v, long *p)
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 @@ get_wrapped_long(PyObject *v, long *p)
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 @@ get_wrapped_ulong(PyObject *v, unsigned long *p)
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 @@ get_wrapped_ulong(PyObject *v, unsigned long *p)
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 @@ _range_error(const formatdef *f, int is_unsigned)
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;