mirror of
https://github.com/python/cpython.git
synced 2025-11-30 14:59:12 +00:00
just throw a normal AttributeError for no buffer attribute
This commit is contained in:
parent
2a8b54d29c
commit
6a38ceda03
2 changed files with 3 additions and 9 deletions
|
|
@ -15,6 +15,9 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Accessing io.StringIO.buffer now raises an AttributeError instead of
|
||||||
|
io.UnsupportedOperation.
|
||||||
|
|
||||||
- Issue #6271: mmap tried to close invalid file handle (-1) when annonymous.
|
- Issue #6271: mmap tried to close invalid file handle (-1) when annonymous.
|
||||||
(On Unix)
|
(On Unix)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -645,14 +645,6 @@ stringio_writable(stringio *self, PyObject *args)
|
||||||
Py_RETURN_TRUE;
|
Py_RETURN_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
|
||||||
stringio_buffer(stringio *self, void *context)
|
|
||||||
{
|
|
||||||
PyErr_SetString(IO_STATE->unsupported_operation,
|
|
||||||
"buffer attribute is unsupported on type StringIO");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
stringio_closed(stringio *self, void *context)
|
stringio_closed(stringio *self, void *context)
|
||||||
{
|
{
|
||||||
|
|
@ -703,7 +695,6 @@ static PyGetSetDef stringio_getset[] = {
|
||||||
Hopefully, a better solution, than adding these pseudo-attributes,
|
Hopefully, a better solution, than adding these pseudo-attributes,
|
||||||
will be found.
|
will be found.
|
||||||
*/
|
*/
|
||||||
{"buffer", (getter)stringio_buffer, NULL, NULL},
|
|
||||||
{"line_buffering", (getter)stringio_line_buffering, NULL, NULL},
|
{"line_buffering", (getter)stringio_line_buffering, NULL, NULL},
|
||||||
{NULL}
|
{NULL}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue