mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
This commit is contained in:
commit
f006940351
28 changed files with 92 additions and 120 deletions
|
@ -969,8 +969,7 @@ _io_BytesIO___init___impl(bytesio *self, PyObject *initvalue)
|
|||
if (initvalue && initvalue != Py_None) {
|
||||
if (PyBytes_CheckExact(initvalue)) {
|
||||
Py_INCREF(initvalue);
|
||||
Py_XDECREF(self->buf);
|
||||
self->buf = initvalue;
|
||||
Py_SETREF(self->buf, initvalue);
|
||||
self->string_size = PyBytes_GET_SIZE(initvalue);
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue