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 /Python/_warnings.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 'Python/_warnings.c')
-rw-r--r-- | Python/_warnings.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c index 92d6547..8e8c0cc 100644 --- a/Python/_warnings.c +++ b/Python/_warnings.c @@ -528,8 +528,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno, goto handle_error; } else if (!is_true) { - Py_DECREF(*filename); - *filename = PyString_FromString("__main__"); + Py_SETREF(*filename, PyString_FromString("__main__")); if (*filename == NULL) goto handle_error; } |