diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-04-06 06:45:48 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-04-06 06:45:48 (GMT) |
commit | 48842714b948fa239392ddd7e207151d5fcb8bc7 (patch) | |
tree | 7fd1573b10b193f735a2685bb832900608513e7d /Objects/exceptions.c | |
parent | 0e0563ca2c6d67126f33ea077ddea19af71f14eb (diff) | |
download | cpython-48842714b948fa239392ddd7e207151d5fcb8bc7.zip cpython-48842714b948fa239392ddd7e207151d5fcb8bc7.tar.gz cpython-48842714b948fa239392ddd7e207151d5fcb8bc7.tar.bz2 |
Issue #22570: Renamed Py_SETREF to Py_XSETREF.
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r-- | Objects/exceptions.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 85f9472..d03aada 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -206,7 +206,7 @@ BaseException_set_args(PyBaseExceptionObject *self, PyObject *val) seq = PySequence_Tuple(val); if (!seq) return -1; - Py_SETREF(self->args, seq); + Py_XSETREF(self->args, seq); return 0; } @@ -235,7 +235,7 @@ BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb) } Py_XINCREF(tb); - Py_SETREF(self->traceback, tb); + Py_XSETREF(self->traceback, tb); return 0; } @@ -563,11 +563,11 @@ SystemExit_init(PySystemExitObject *self, PyObject *args, PyObject *kwds) return 0; if (size == 1) { Py_INCREF(PyTuple_GET_ITEM(args, 0)); - Py_SETREF(self->code, PyTuple_GET_ITEM(args, 0)); + Py_XSETREF(self->code, PyTuple_GET_ITEM(args, 0)); } else { /* size > 1 */ Py_INCREF(args); - Py_SETREF(self->code, args); + Py_XSETREF(self->code, args); } return 0; } @@ -628,7 +628,7 @@ ImportError_init(PyImportErrorObject *self, PyObject *args, PyObject *kwds) kwd = PyDict_GetItemString(kwds, #kwd); \ if (kwd) { \ Py_INCREF(kwd); \ - Py_SETREF(self->kwd, kwd); \ + Py_XSETREF(self->kwd, kwd); \ if (PyDict_DelItemString(kwds, #kwd)) \ return -1; \ } \ @@ -647,7 +647,7 @@ ImportError_init(PyImportErrorObject *self, PyObject *args, PyObject *kwds) return -1; Py_INCREF(msg); - Py_SETREF(self->msg, msg); + Py_XSETREF(self->msg, msg); return 0; } @@ -857,7 +857,7 @@ oserror_init(PyOSErrorObject *self, PyObject **p_args, #endif /* Steals the reference to args */ - Py_SETREF(self->args, args); + Py_XSETREF(self->args, args); *p_args = args = NULL; return 0; @@ -1277,7 +1277,7 @@ SyntaxError_init(PySyntaxErrorObject *self, PyObject *args, PyObject *kwds) if (lenargs >= 1) { Py_INCREF(PyTuple_GET_ITEM(args, 0)); - Py_SETREF(self->msg, PyTuple_GET_ITEM(args, 0)); + Py_XSETREF(self->msg, PyTuple_GET_ITEM(args, 0)); } if (lenargs == 2) { info = PyTuple_GET_ITEM(args, 1); @@ -1293,16 +1293,16 @@ SyntaxError_init(PySyntaxErrorObject *self, PyObject *args, PyObject *kwds) } Py_INCREF(PyTuple_GET_ITEM(info, 0)); - Py_SETREF(self->filename, PyTuple_GET_ITEM(info, 0)); + Py_XSETREF(self->filename, PyTuple_GET_ITEM(info, 0)); Py_INCREF(PyTuple_GET_ITEM(info, 1)); - Py_SETREF(self->lineno, PyTuple_GET_ITEM(info, 1)); + Py_XSETREF(self->lineno, PyTuple_GET_ITEM(info, 1)); Py_INCREF(PyTuple_GET_ITEM(info, 2)); - Py_SETREF(self->offset, PyTuple_GET_ITEM(info, 2)); + Py_XSETREF(self->offset, PyTuple_GET_ITEM(info, 2)); Py_INCREF(PyTuple_GET_ITEM(info, 3)); - Py_SETREF(self->text, PyTuple_GET_ITEM(info, 3)); + Py_XSETREF(self->text, PyTuple_GET_ITEM(info, 3)); Py_DECREF(info); @@ -1547,7 +1547,7 @@ set_unicodefromstring(PyObject **attr, const char *value) PyObject *obj = PyUnicode_FromString(value); if (!obj) return -1; - Py_SETREF(*attr, obj); + Py_XSETREF(*attr, obj); return 0; } @@ -1953,7 +1953,7 @@ UnicodeDecodeError_init(PyObject *self, PyObject *args, PyObject *kwds) Py_buffer view; if (PyObject_GetBuffer(ude->object, &view, PyBUF_SIMPLE) != 0) goto error; - Py_SETREF(ude->object, PyBytes_FromStringAndSize(view.buf, view.len)); + Py_XSETREF(ude->object, PyBytes_FromStringAndSize(view.buf, view.len)); PyBuffer_Release(&view); if (!ude->object) goto error; @@ -2862,7 +2862,7 @@ _check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start) } if (PyUnicode_Tailmatch(self->text, print_prefix, start, text_len, -1)) { - Py_SETREF(self->msg, + Py_XSETREF(self->msg, PyUnicode_FromString("Missing parentheses in call to 'print'")); return 1; } @@ -2876,7 +2876,7 @@ _check_for_legacy_statements(PySyntaxErrorObject *self, Py_ssize_t start) } if (PyUnicode_Tailmatch(self->text, exec_prefix, start, text_len, -1)) { - Py_SETREF(self->msg, + Py_XSETREF(self->msg, PyUnicode_FromString("Missing parentheses in call to 'exec'")); return 1; } |