diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-03-05 14:36:20 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-03-05 14:36:20 (GMT) |
commit | 1c0c78c61f440de7187f62ecdd1cc828f0a2e95e (patch) | |
tree | ecd9c92d3e4533795ee8704e00cd4ffe8a9e9fdd /Modules/_struct.c | |
parent | 3bbb67273a8c146a38de91080a37e716e2699622 (diff) | |
download | cpython-1c0c78c61f440de7187f62ecdd1cc828f0a2e95e.zip cpython-1c0c78c61f440de7187f62ecdd1cc828f0a2e95e.tar.gz cpython-1c0c78c61f440de7187f62ecdd1cc828f0a2e95e.tar.bz2 |
Fix incorrect stacklevel for DeprecationWarnings originating from the struct module.
Also clean up related tests in test_struct.
The stacklevel fix should be backported to 2.6 once that branch is unfrozen.
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r-- | Modules/_struct.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c index 27f8881..d7cc77f 100644 --- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -121,7 +121,7 @@ get_pylong(PyObject *v) } #ifdef PY_STRUCT_FLOAT_COERCE if (PyFloat_Check(v)) { - if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 2)<0) + if (PyErr_WarnEx(PyExc_DeprecationWarning, FLOAT_COERCE, 1)<0) return NULL; return PyNumber_Long(v); } |