diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/_warnings.c | 3 | ||||
-rw-r--r-- | Python/ceval.c | 3 | ||||
-rw-r--r-- | Python/compile.c | 5 |
3 files changed, 4 insertions, 7 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; } diff --git a/Python/ceval.c b/Python/ceval.c index 4fcf25e..6e5e272 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4360,8 +4360,7 @@ call_function(PyObject ***pp_stack, int oparg Py_INCREF(self); func = PyMethod_GET_FUNCTION(func); Py_INCREF(func); - Py_DECREF(*pfunc); - *pfunc = self; + Py_SETREF(*pfunc, self); na++; n++; } else diff --git a/Python/compile.c b/Python/compile.c index 2900757..01b9fe0 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1455,9 +1455,8 @@ compiler_class(struct compiler *c, stmt_ty s) if (!compiler_enter_scope(c, s->v.ClassDef.name, (void *)s, s->lineno)) return 0; - Py_XDECREF(c->u->u_private); - c->u->u_private = s->v.ClassDef.name; - Py_INCREF(c->u->u_private); + Py_INCREF(s->v.ClassDef.name); + Py_SETREF(c->u->u_private, s->v.ClassDef.name); str = PyString_InternFromString("__name__"); if (!str || !compiler_nameop(c, str, Load)) { Py_XDECREF(str); |