summaryrefslogtreecommitdiff
path: root/Python/_warnings.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-12-24 10:35:59 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2015-12-24 10:35:59 +0200
commit585a1eed45faea53f836b1db2ac211d7f14b44c8 (patch)
tree3c5cfaf65c0c2b6a2daa08f73e73ae78b15bffa0 /Python/_warnings.c
parent6044fdd1b841003aeef3852ddc1fa922eaab5dbd (diff)
downloadcpython-585a1eed45faea53f836b1db2ac211d7f14b44c8.tar.gz
Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
Diffstat (limited to 'Python/_warnings.c')
-rw-r--r--Python/_warnings.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 9ca83145c9..978bad135c 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -680,8 +680,7 @@ setup_context(Py_ssize_t stack_level, PyObject **filename, int *lineno,
goto handle_error;
}
else if (!is_true) {
- Py_DECREF(*filename);
- *filename = PyUnicode_FromString("__main__");
+ Py_SETREF(*filename, PyUnicode_FromString("__main__"));
if (*filename == NULL)
goto handle_error;
}