mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Issue #22570: Renamed Py_SETREF to Py_XSETREF.
This commit is contained in:
parent
0e0563ca2c
commit
48842714b9
37 changed files with 132 additions and 132 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue