mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
This commit is contained in:
parent
a198645fa0
commit
5a57ade58e
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