cpython: 9fb57c0209ea (original) (raw)

Mercurial > cpython

changeset 99684:9fb57c0209ea 3.5

Issue #20440: Applied yet one patch for using Py_SETREF. The patch is automatically generated, it replaces the code that uses Py_CLEAR. [#20440]

Serhiy Storchaka storchaka@gmail.com
date Sun, 27 Dec 2015 12:36:18 +0200
parents 2af2367d7eda
children bc7c56a225de 4bfbb2714ae9
files Modules/_bz2module.c Modules/_io/bufferedio.c Modules/_io/textio.c Modules/_lzmamodule.c Modules/_pickle.c Modules/_struct.c Modules/cjkcodecs/multibytecodec.c Modules/itertoolsmodule.c Objects/exceptions.c Objects/rangeobject.c Python/ceval.c
diffstat 11 files changed, 66 insertions(+), 109 deletions(-)[+] [-] Modules/_bz2module.c 5 Modules/_io/bufferedio.c 12 Modules/_io/textio.c 12 Modules/_lzmamodule.c 5 Modules/_pickle.c 8 Modules/_struct.c 3 Modules/cjkcodecs/multibytecodec.c 3 Modules/itertoolsmodule.c 57 Objects/exceptions.c 58 Objects/rangeobject.c 8 Python/ceval.c 4

line wrap: on

line diff

--- a/Modules/_bz2module.c +++ b/Modules/_bz2module.c @@ -540,9 +540,8 @@ decompress(BZ2Decompressor *d, char *dat if (d->eof) { d->needs_input = 0; if (d->bzs_avail_in_real > 0) {

--- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -1196,8 +1196,7 @@ found: Py_CLEAR(res); goto end; }

end: LEAVE_BUFFERED(self) @@ -1452,9 +1451,8 @@ static int if (_PyIOBase_check_readable(raw, Py_True) == NULL) return -1;

--- a/Modules/_io/textio.c +++ b/Modules/_io/textio.c @@ -995,8 +995,7 @@ static int "Oi", self->decoder, (int)self->readtranslate); if (incrementalDecoder == NULL) goto error;

@@ -1523,8 +1521,7 @@ textiowrapper_read_chunk(textio self, P dec_buffer = NULL; / Reference lost to PyBytes_Concat */ goto fail; }

--- a/Modules/_lzmamodule.c +++ b/Modules/_lzmamodule.c @@ -1011,9 +1011,8 @@ decompress(Decompressor *d, uint8_t *dat if (d->eof) { d->needs_input = 0; if (lzs->avail_in > 0) {

--- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -846,9 +846,8 @@ PyMemoTable_Set(PyMemoTable *self, PyObj static int _Pickler_ClearBuffer(PicklerObject *self) {

--- a/Modules/_struct.c +++ b/Modules/_struct.c @@ -1437,8 +1437,7 @@ s_init(PyObject *self, PyObject *args, P return -1; }

ret = prepare_s(soself); return ret;

--- a/Modules/cjkcodecs/multibytecodec.c +++ b/Modules/cjkcodecs/multibytecodec.c @@ -793,8 +793,7 @@ encoder_encode_stateful(MultibyteStatefu ctx->errors, final ? MBENC_FLUSH | MBENC_RESET : 0); if (r == NULL) { /* recover the original pending buffer */

--- a/Modules/itertoolsmodule.c +++ b/Modules/itertoolsmodule.c @@ -159,15 +159,12 @@ groupby_setstate(groupbyobject *lz, PyOb PyObject *currkey, *currvalue, *tgtkey; if (!PyArg_ParseTuple(state, "OOO", &currkey, &currvalue, &tgtkey)) return NULL;

@@ -747,9 +744,8 @@ tee_setstate(teeobject *to, PyObject *st PyErr_SetString(PyExc_ValueError, "Index out of range"); return NULL; }

@@ -974,9 +970,8 @@ cycle_setstate(cycleobject *lz, PyObject int firstpass; if (!PyArg_ParseTuple(state, "Oi", &saved, &firstpass)) return NULL;

@@ -1901,12 +1896,10 @@ chain_setstate(chainobject *lz, PyObject if (! PyArg_ParseTuple(state, "O|O", &source, &active)) return NULL;

@@ -2262,8 +2255,7 @@ product_setstate(productobject *lz, PyOb Py_INCREF(element); PyTuple_SET_ITEM(result, i, element); }

@@ -2585,8 +2577,7 @@ combinations_setstate(combinationsobject PyTuple_SET_ITEM(result, i, element); }

@@ -2916,8 +2907,7 @@ cwr_setstate(cwrobject *lz, PyObject *st Py_INCREF(element); PyTuple_SET_ITEM(result, i, element); }

@@ -3310,8 +3300,7 @@ permutations_setstate(permutationsobject Py_INCREF(element); PyTuple_SET_ITEM(result, i, element); }

@@ -3481,9 +3470,8 @@ accumulate_reduce(accumulateobject *lz) static PyObject * accumulate_setstate(accumulateobject *lz, PyObject *state) {

@@ -4464,9 +4452,8 @@ zip_longest_reduce(ziplongestobject *lz) static PyObject * zip_longest_setstate(ziplongestobject *lz, PyObject *state) {

--- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -206,8 +206,7 @@ BaseException_set_args(PyBaseExceptionOb seq = PySequence_Tuple(val); if (!seq) return -1;

@@ -646,9 +645,8 @@ ImportError_init(PyImportErrorObject *se if (!PyArg_UnpackTuple(args, "ImportError", 1, 1, &msg)) return -1;

return 0; } @@ -858,8 +856,7 @@ oserror_init(PyOSErrorObject self, PyOb #endif / Steals the reference to args */

if (lenargs >= 1) {

@@ -1295,21 +1291,17 @@ SyntaxError_init(PySyntaxErrorObject *se return -1; }

-

-

-

+

+

+

Py_DECREF(info); @@ -1554,8 +1546,7 @@ set_unicodefromstring(PyObject **attr, c PyObject *obj = PyUnicode_FromString(value); if (!obj) return -1;

@@ -1961,8 +1952,7 @@ UnicodeDecodeError_init(PyObject *self, Py_buffer view; if (PyObject_GetBuffer(ude->object, &view, PyBUF_SIMPLE) != 0) goto error;

@@ -2871,9 +2861,8 @@ static int } if (PyUnicode_Tailmatch(self->text, print_prefix, start, text_len, -1)) {

--- a/Objects/rangeobject.c +++ b/Objects/rangeobject.c @@ -1001,8 +1001,7 @@ longrangeiter_setstate(longrangeiterobje return NULL; cmp = PyObject_RichCompareBool(state, zero, Py_LT); if (cmp > 0) {

--- a/Python/ceval.c +++ b/Python/ceval.c @@ -4410,10 +4410,8 @@ void { PyThreadState *tstate = PyThreadState_GET();

- Py_XINCREF(wrapper);

} PyObject *