mirror of https://github.com/python/cpython.git
gh-111178: fix UBSan failures for `PyStdPrinter_Object` (#131607)
This commit is contained in:
parent
f65be097ed
commit
27f81e82df
|
@ -404,27 +404,27 @@ static PyMethodDef stdprinter_methods[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
get_closed(PyStdPrinter_Object *self, void *closure)
|
get_closed(PyObject *self, void *Py_UNUSED(closure))
|
||||||
{
|
{
|
||||||
Py_RETURN_FALSE;
|
Py_RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
get_mode(PyStdPrinter_Object *self, void *closure)
|
get_mode(PyObject *self, void *Py_UNUSED(closure))
|
||||||
{
|
{
|
||||||
return PyUnicode_FromString("w");
|
return PyUnicode_FromString("w");
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
get_encoding(PyStdPrinter_Object *self, void *closure)
|
get_encoding(PyObject *self, void *Py_UNUSED(closure))
|
||||||
{
|
{
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyGetSetDef stdprinter_getsetlist[] = {
|
static PyGetSetDef stdprinter_getsetlist[] = {
|
||||||
{"closed", (getter)get_closed, NULL, "True if the file is closed"},
|
{"closed", get_closed, NULL, "True if the file is closed"},
|
||||||
{"encoding", (getter)get_encoding, NULL, "Encoding of the file"},
|
{"encoding", get_encoding, NULL, "Encoding of the file"},
|
||||||
{"mode", (getter)get_mode, NULL, "String giving the file mode"},
|
{"mode", get_mode, NULL, "String giving the file mode"},
|
||||||
{0},
|
{0},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue