summaryrefslogtreecommitdiffstats
path: root/Modules/_struct.c
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-04-04 08:52:51 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-04-04 08:52:51 (GMT)
commite9493a1872b122097e6bd7660398c267b966d2f6 (patch)
tree879c21fe07539507838651ddc1f41113c0b2fa23 /Modules/_struct.c
parent4c28ddc2f2356e19d10b11eb671ad934e6d07f8b (diff)
downloadcpython-e9493a1872b122097e6bd7660398c267b966d2f6.zip
cpython-e9493a1872b122097e6bd7660398c267b966d2f6.tar.gz
cpython-e9493a1872b122097e6bd7660398c267b966d2f6.tar.bz2
Merged revisions 79745 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79745 | mark.dickinson | 2010-04-04 09:43:04 +0100 (Sun, 04 Apr 2010) | 3 lines Issue #8300 (__index__ handling in struct.pack): Remove redundant check and improve test coverage. Thanks Meador Inge for the patch. ........
Diffstat (limited to 'Modules/_struct.c')
-rw-r--r--Modules/_struct.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/Modules/_struct.c b/Modules/_struct.c
index d000df2..94bc397 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -102,12 +102,6 @@ get_pylong(PyObject *v)
v = PyNumber_Index(v);
if (v == NULL)
return NULL;
- if (!PyLong_Check(v)) {
- PyErr_SetString(PyExc_TypeError,
- "__index__ method "
- "returned non-integer");
- return NULL;
- }
}
else {
PyErr_SetString(StructError,
@@ -118,6 +112,7 @@ get_pylong(PyObject *v)
else
Py_INCREF(v);
+ assert(PyLong_Check(v));
return v;
}