cpython: 539ba7267701 (original) (raw)

Mercurial > cpython

changeset 99689:539ba7267701

Issue #20440: More use of Py_SETREF. This patch is manually crafted and contains changes that couldn't be handled automatically. [#20440]

Serhiy Storchaka storchaka@gmail.com
date Sun, 27 Dec 2015 15:44:33 +0200
parents bc7c56a225de(current diff)4bfbb2714ae9(diff)
children b02d256b8827
files Modules/_ctypes/_ctypes.c Modules/_elementtree.c Modules/_sqlite/cursor.c Modules/zlibmodule.c Objects/unicodeobject.c Python/ast.c
diffstat 8 files changed, 40 insertions(+), 63 deletions(-)[+] [-] Modules/_ctypes/_ctypes.c 3 Modules/_elementtree.c 34 Modules/_sqlite/cursor.c 4 Modules/zlibmodule.c 18 Objects/exceptions.c 19 Objects/unicodeobject.c 2 Python/ast.c 10 Python/errors.c 13

line wrap: on

line diff

--- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -2983,10 +2983,9 @@ PyCFuncPtr_set_restype(PyCFuncPtrObject "restype must be a type, a callable, or None"); return -1; }

--- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -965,9 +965,8 @@ element_setstate_from_attributes(Element return NULL; }

_clear_joined_ptr(&self->text); self->text = text ? JOIN_SET(text, PyList_CheckExact(text)) : Py_None; @@ -1010,9 +1009,8 @@ element_setstate_from_attributes(Element /* Stash attrib. */ if (attrib) {

@@ -1995,8 +1992,7 @@ element_attrib_setter(ElementObject *sel return -1; } Py_INCREF(value);

@@ -2533,13 +2529,10 @@ treebuilder_handle_start(TreeBuilderObje } self->index++;

-

if (treebuilder_append_event(self, self->start_event_obj, node) < 0) goto error; @@ -2612,15 +2605,12 @@ treebuilder_handle_end(TreeBuilderObject return NULL; }

-

-

if (treebuilder_append_event(self, self->end_event_obj, self->last) < 0) return NULL;

--- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -524,10 +524,10 @@ PyObject* _pysqlite_query_execute(pysqli if (self->statement) { (void)pysqlite_statement_reset(self->statement);

--- a/Modules/zlibmodule.c +++ b/Modules/zlibmodule.c @@ -961,14 +961,11 @@ zlib_Compress_copy_impl(compobject *self goto error; } Py_INCREF(self->unused_data);

--- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -561,12 +561,14 @@ SystemExit_init(PySystemExitObject *self if (size == 0) return 0;

@@ -625,9 +627,8 @@ ImportError_init(PyImportErrorObject *se #define GET_KWD(kwd) { [](#l5.25) kwd = PyDict_GetItemString(kwds, #kwd); [](#l5.26) if (kwd) { [](#l5.27)

--- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -14443,8 +14443,8 @@ unicode_format_arg_parse(struct unicode_ if (key == NULL) return -1; if (ctx->args_owned) {

--- a/Python/ast.c +++ b/Python/ast.c @@ -4496,8 +4496,7 @@ fstring_find_literal_and_expr(PyObject * return 0; error:

@@ -4692,11 +4691,8 @@ FstringParser_ConcatAndDel(FstringParser state->last_str = str; } else { /* Concatenate this with the previous string. */

--- a/Python/errors.c +++ b/Python/errors.c @@ -315,14 +315,11 @@ finally: tstate = PyThreadState_GET(); if (++tstate->recursion_depth > Py_GetRecursionLimit()) { --tstate->recursion_depth;