summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2008-01-16 19:45:51 (GMT)
committerThomas Heller <theller@ctypes.org>2008-01-16 19:45:51 (GMT)
commit415c1e36a9f3cb119fad8aa5fcdcc9f31284782e (patch)
tree39db49aa09e4dc2cff313097c656af4414320143 /Modules
parent02ec289f3e16ee6b00ecf7ec8f8e0f2a3e1ad152 (diff)
downloadcpython-415c1e36a9f3cb119fad8aa5fcdcc9f31284782e.zip
cpython-415c1e36a9f3cb119fad8aa5fcdcc9f31284782e.tar.gz
cpython-415c1e36a9f3cb119fad8aa5fcdcc9f31284782e.tar.bz2
Raise a TypeError instead of a ValueError when too many initializers
are used in a Structure or Union constructor.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/_ctypes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 8c66194..24d3c2f 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -3557,7 +3557,7 @@ Struct_init(PyObject *self, PyObject *args, PyObject *kwds)
if (PyTuple_GET_SIZE(args) > PySequence_Length(fields)) {
Py_DECREF(fields);
- PyErr_SetString(PyExc_ValueError,
+ PyErr_SetString(PyExc_TypeError,
"too many initializers");
return -1;
}