diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-24 08:35:35 (GMT) |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-24 08:35:35 (GMT) |
| commit | 5951f2300f43d75d344d542e171daed47a0382a6 (patch) | |
| tree | 2e173dda0c0d4c4bf887e8a6a309430d0d9cd5be /Objects/fileobject.c | |
| parent | 6ed42ea08b3a961944e94f1dd941ffabc7657065 (diff) | |
| download | cpython-5951f2300f43d75d344d542e171daed47a0382a6.zip cpython-5951f2300f43d75d344d542e171daed47a0382a6.tar.gz cpython-5951f2300f43d75d344d542e171daed47a0382a6.tar.bz2 | |
Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
Diffstat (limited to 'Objects/fileobject.c')
| -rw-r--r-- | Objects/fileobject.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 55e074b..9ae068c 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -574,10 +574,8 @@ PyFile_SetEncodingAndErrors(PyObject *f, const char *enc, char* errors) oerrors = Py_None; Py_INCREF(Py_None); } - Py_DECREF(file->f_encoding); - file->f_encoding = str; - Py_DECREF(file->f_errors); - file->f_errors = oerrors; + Py_SETREF(file->f_encoding, str); + Py_SETREF(file->f_errors, oerrors); return 1; } |
