mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +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
|
|
@ -524,9 +524,8 @@ fp_setreadl(struct tok_state *tok, const char* enc)
|
|||
if (stream == NULL)
|
||||
goto cleanup;
|
||||
|
||||
Py_XDECREF(tok->decoding_readline);
|
||||
readline = _PyObject_GetAttrId(stream, &PyId_readline);
|
||||
tok->decoding_readline = readline;
|
||||
Py_SETREF(tok->decoding_readline, readline);
|
||||
if (pos > 0) {
|
||||
if (PyObject_CallObject(readline, NULL) == NULL) {
|
||||
readline = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue