Issue #20440: Massive replacing unsafe attribute setting code with special

macro Py_SETREF.
This commit is contained in:
Serhiy Storchaka 2015-12-24 10:39:57 +02:00
commit f006940351
28 changed files with 92 additions and 120 deletions

View file

@ -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;