summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-04-06 06:50:03 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-04-06 06:50:03 (GMT)
commitec39756960def5fdd8cb0ae191429f2f8e229f55 (patch)
treeadb8bb87ed393db602face59929660b968f452e5 /Objects/exceptions.c
parent72783056983f216104087b6c49d85ea273bf67c4 (diff)
parent48842714b948fa239392ddd7e207151d5fcb8bc7 (diff)
downloadcpython-ec39756960def5fdd8cb0ae191429f2f8e229f55.zip
cpython-ec39756960def5fdd8cb0ae191429f2f8e229f55.tar.gz
cpython-ec39756960def5fdd8cb0ae191429f2f8e229f55.tar.bz2
Issue #22570: Renamed Py_SETREF to Py_XSETREF.
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index 7374368..2c7688c 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -63,7 +63,7 @@ BaseException_init(PyBaseExceptionObject *self, PyObject *args, PyObject *kwds)
return -1;
Py_INCREF(args);
- Py_SETREF(self->args, args);
+ Py_XSETREF(self->args, args);
return 0;
}
@@ -202,7 +202,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;
}
@@ -231,7 +231,7 @@ BaseException_set_tb(PyBaseExceptionObject *self, PyObject *tb)
}
Py_XINCREF(tb);
- Py_SETREF(self->traceback, tb);
+ Py_XSETREF(self->traceback, tb);
return 0;
}
@@ -327,7 +327,7 @@ void
PyException_SetCause(PyObject *self, PyObject *cause)
{
((PyBaseExceptionObject *)self)->suppress_context = 1;
- Py_SETREF(((PyBaseExceptionObject *)self)->cause, cause);
+ Py_XSETREF(((PyBaseExceptionObject *)self)->cause, cause);
}
PyObject *
@@ -341,7 +341,7 @@ PyException_GetContext(PyObject *self) {
void
PyException_SetContext(PyObject *self, PyObject *context)
{
- Py_SETREF(((PyBaseExceptionObject *)self)->context, context);
+ Py_XSETREF(((PyBaseExceptionObject *)self)->context, context);
}
@@ -557,11 +557,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;
}
@@ -622,7 +622,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; \
} \
@@ -641,7 +641,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;
}
@@ -851,7 +851,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;
@@ -1271,7 +1271,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);
@@ -1287,16 +1287,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);
@@ -1541,7 +1541,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;
}
@@ -1947,7 +1947,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;
@@ -2856,7 +2856,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;
}
@@ -2870,7 +2870,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;
}