summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorHye-Shik Chang <hyeshik@gmail.com>2006-04-21 16:21:44 (GMT)
committerHye-Shik Chang <hyeshik@gmail.com>2006-04-21 16:21:44 (GMT)
commit13247bfc8bd35cedcb44a3a8ec9d89e7c1a9f7ef (patch)
treebd48e176d2b1601aacbed14ea8dd88b4bb0293e3 /Modules
parent6da48561cb7844526164d3a656c6d16afe904e3d (diff)
downloadcpython-13247bfc8bd35cedcb44a3a8ec9d89e7c1a9f7ef.zip
cpython-13247bfc8bd35cedcb44a3a8ec9d89e7c1a9f7ef.tar.gz
cpython-13247bfc8bd35cedcb44a3a8ec9d89e7c1a9f7ef.tar.bz2
Add empty __init__ methods for stateful multibytecodec instances.
This resolves a problem found by Thomas Wouters: http://mail.python.org/pipermail/python-dev/2006-April/064051.html
Diffstat (limited to 'Modules')
-rw-r--r--Modules/cjkcodecs/multibytecodec.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/Modules/cjkcodecs/multibytecodec.c b/Modules/cjkcodecs/multibytecodec.c
index 340de18..aa0096a 100644
--- a/Modules/cjkcodecs/multibytecodec.c
+++ b/Modules/cjkcodecs/multibytecodec.c
@@ -927,6 +927,12 @@ errorexit:
}
static int
+mbiencoder_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ return 0;
+}
+
+static int
mbiencoder_traverse(MultibyteIncrementalEncoderObject *self,
visitproc visit, void *arg)
{
@@ -982,7 +988,7 @@ static PyTypeObject MultibyteIncrementalEncoder_Type = {
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
- 0, /* tp_init */
+ mbiencoder_init, /* tp_init */
0, /* tp_alloc */
mbiencoder_new, /* tp_new */
};
@@ -1122,6 +1128,12 @@ errorexit:
}
static int
+mbidecoder_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ return 0;
+}
+
+static int
mbidecoder_traverse(MultibyteIncrementalDecoderObject *self,
visitproc visit, void *arg)
{
@@ -1177,7 +1189,7 @@ static PyTypeObject MultibyteIncrementalDecoder_Type = {
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
- 0, /* tp_init */
+ mbidecoder_init, /* tp_init */
0, /* tp_alloc */
mbidecoder_new, /* tp_new */
};
@@ -1427,6 +1439,12 @@ errorexit:
}
static int
+mbstreamreader_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ return 0;
+}
+
+static int
mbstreamreader_traverse(MultibyteStreamReaderObject *self,
visitproc visit, void *arg)
{
@@ -1484,7 +1502,7 @@ static PyTypeObject MultibyteStreamReader_Type = {
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
- 0, /* tp_init */
+ mbstreamreader_init, /* tp_init */
0, /* tp_alloc */
mbstreamreader_new, /* tp_new */
};
@@ -1632,6 +1650,12 @@ errorexit:
}
static int
+mbstreamwriter_init(PyObject *self, PyObject *args, PyObject *kwds)
+{
+ return 0;
+}
+
+static int
mbstreamwriter_traverse(MultibyteStreamWriterObject *self,
visitproc visit, void *arg)
{
@@ -1706,7 +1730,7 @@ static PyTypeObject MultibyteStreamWriter_Type = {
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
- 0, /* tp_init */
+ mbstreamwriter_init, /* tp_init */
0, /* tp_alloc */
mbstreamwriter_new, /* tp_new */
};