mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Backport p3yk r45619:
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
This commit is contained in:
parent
0d840285c7
commit
db8955bc54
1 changed files with 28 additions and 4 deletions
|
|
@ -926,6 +926,12 @@ errorexit:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
mbiencoder_init(PyObject *self, PyObject *args, PyObject *kwds)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mbiencoder_traverse(MultibyteIncrementalEncoderObject *self,
|
mbiencoder_traverse(MultibyteIncrementalEncoderObject *self,
|
||||||
visitproc visit, void *arg)
|
visitproc visit, void *arg)
|
||||||
|
|
@ -982,7 +988,7 @@ static PyTypeObject MultibyteIncrementalEncoder_Type = {
|
||||||
0, /* tp_descr_get */
|
0, /* tp_descr_get */
|
||||||
0, /* tp_descr_set */
|
0, /* tp_descr_set */
|
||||||
0, /* tp_dictoffset */
|
0, /* tp_dictoffset */
|
||||||
0, /* tp_init */
|
mbiencoder_init, /* tp_init */
|
||||||
0, /* tp_alloc */
|
0, /* tp_alloc */
|
||||||
mbiencoder_new, /* tp_new */
|
mbiencoder_new, /* tp_new */
|
||||||
};
|
};
|
||||||
|
|
@ -1121,6 +1127,12 @@ errorexit:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
mbidecoder_init(PyObject *self, PyObject *args, PyObject *kwds)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mbidecoder_traverse(MultibyteIncrementalDecoderObject *self,
|
mbidecoder_traverse(MultibyteIncrementalDecoderObject *self,
|
||||||
visitproc visit, void *arg)
|
visitproc visit, void *arg)
|
||||||
|
|
@ -1177,7 +1189,7 @@ static PyTypeObject MultibyteIncrementalDecoder_Type = {
|
||||||
0, /* tp_descr_get */
|
0, /* tp_descr_get */
|
||||||
0, /* tp_descr_set */
|
0, /* tp_descr_set */
|
||||||
0, /* tp_dictoffset */
|
0, /* tp_dictoffset */
|
||||||
0, /* tp_init */
|
mbidecoder_init, /* tp_init */
|
||||||
0, /* tp_alloc */
|
0, /* tp_alloc */
|
||||||
mbidecoder_new, /* tp_new */
|
mbidecoder_new, /* tp_new */
|
||||||
};
|
};
|
||||||
|
|
@ -1426,6 +1438,12 @@ errorexit:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
mbstreamreader_init(PyObject *self, PyObject *args, PyObject *kwds)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mbstreamreader_traverse(MultibyteStreamReaderObject *self,
|
mbstreamreader_traverse(MultibyteStreamReaderObject *self,
|
||||||
visitproc visit, void *arg)
|
visitproc visit, void *arg)
|
||||||
|
|
@ -1484,7 +1502,7 @@ static PyTypeObject MultibyteStreamReader_Type = {
|
||||||
0, /* tp_descr_get */
|
0, /* tp_descr_get */
|
||||||
0, /* tp_descr_set */
|
0, /* tp_descr_set */
|
||||||
0, /* tp_dictoffset */
|
0, /* tp_dictoffset */
|
||||||
0, /* tp_init */
|
mbstreamreader_init, /* tp_init */
|
||||||
0, /* tp_alloc */
|
0, /* tp_alloc */
|
||||||
mbstreamreader_new, /* tp_new */
|
mbstreamreader_new, /* tp_new */
|
||||||
};
|
};
|
||||||
|
|
@ -1631,6 +1649,12 @@ errorexit:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
mbstreamwriter_init(PyObject *self, PyObject *args, PyObject *kwds)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mbstreamwriter_traverse(MultibyteStreamWriterObject *self,
|
mbstreamwriter_traverse(MultibyteStreamWriterObject *self,
|
||||||
visitproc visit, void *arg)
|
visitproc visit, void *arg)
|
||||||
|
|
@ -1706,7 +1730,7 @@ static PyTypeObject MultibyteStreamWriter_Type = {
|
||||||
0, /* tp_descr_get */
|
0, /* tp_descr_get */
|
||||||
0, /* tp_descr_set */
|
0, /* tp_descr_set */
|
||||||
0, /* tp_dictoffset */
|
0, /* tp_dictoffset */
|
||||||
0, /* tp_init */
|
mbstreamwriter_init, /* tp_init */
|
||||||
0, /* tp_alloc */
|
0, /* tp_alloc */
|
||||||
mbstreamwriter_new, /* tp_new */
|
mbstreamwriter_new, /* tp_new */
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue