Lines Matching defs:args

42 BaseException_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
55 if (args) {
56 self->args = args;
57 Py_INCREF(args);
61 self->args = PyTuple_New(0);
62 if (!self->args) {
71 BaseException_init(PyBaseExceptionObject *self, PyObject *args, PyObject *kwds)
76 Py_INCREF(args);
77 Py_XSETREF(self->args, args);
86 Py_CLEAR(self->args);
111 Py_VISIT(self->args);
122 switch (PyTuple_GET_SIZE(self->args)) {
126 return PyObject_Str(PyTuple_GET_ITEM(self->args, 0));
128 return PyObject_Str(self->args);
136 if (PyTuple_GET_SIZE(self->args) == 1)
138 PyTuple_GET_ITEM(self->args, 0));
140 return PyUnicode_FromFormat("%s%R", name, self->args);
147 if (self->args && self->dict)
148 return PyTuple_Pack(3, Py_TYPE(self), self->args, self->dict);
150 return PyTuple_Pack(2, Py_TYPE(self), self->args);
258 if (self->args == NULL) {
261 Py_INCREF(self->args);
262 return self->args;
270 PyErr_SetString(PyExc_TypeError, "args may not be deleted");
276 Py_XSETREF(self->args, seq);
369 {"args", (getter)BaseException_get_args, (setter)BaseException_set_args},
570 StopIteration_init(PyStopIterationObject *self, PyObject *args, PyObject *kwds)
572 Py_ssize_t size = PyTuple_GET_SIZE(args);
575 if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
579 value = PyTuple_GET_ITEM(args, 0);
634 SystemExit_init(PySystemExitObject *self, PyObject *args, PyObject *kwds)
636 Py_ssize_t size = PyTuple_GET_SIZE(args);
638 if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
644 Py_INCREF(PyTuple_GET_ITEM(args, 0));
645 Py_XSETREF(self->code, PyTuple_GET_ITEM(args, 0));
648 Py_INCREF(args);
649 Py_XSETREF(self->code, args);
700 BaseExceptionGroup_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
709 if (!PyArg_ParseTuple(args,
799 _PyBaseExceptionGroupObject_cast(BaseException_new(cls, args, kwds));
819 PyObject *args = PyTuple_Pack(2, msg, excs);
821 if (!args) {
824 PyObject *result = PyObject_CallObject(PyExc_BaseExceptionGroup, args);
825 Py_DECREF(args);
831 PyObject *args, PyObject *kwds)
836 if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1) {
881 BaseExceptionGroup_derive(PyObject *self_, PyObject *args)
885 if (!PyArg_ParseTuple(args, "O", &excs)) {
1181 BaseExceptionGroup_split(PyObject *self, PyObject *args)
1184 if (!PyArg_UnpackTuple(args, "split", 1, 1, &matcher_value)) {
1212 BaseExceptionGroup_subgroup(PyObject *self, PyObject *args)
1215 if (!PyArg_UnpackTuple(args, "subgroup", 1, 1, &matcher_value)) {
1499 ImportError_init(PyImportErrorObject *self, PyObject *args, PyObject *kwds)
1507 if (BaseException_init((PyBaseExceptionObject *)self, args, NULL) == -1)
1526 if (PyTuple_GET_SIZE(args) == 1) {
1527 msg = PyTuple_GET_ITEM(args, 0);
1605 PyObject *args;
1609 args = ((PyBaseExceptionObject *)self)->args;
1611 res = PyTuple_Pack(2, Py_TYPE(self), args);
1613 res = PyTuple_Pack(3, Py_TYPE(self), args, state);
1662 * we hack args so that it only contains two items. This also
1682 PyObject *args = *p_args;
1692 nargs = PyTuple_GET_SIZE(args);
1695 if (!PyArg_UnpackTuple(args, "OSError", 2, 5,
1717 PyObject *val = PyTuple_GET_ITEM(args, i);
1721 Py_DECREF(args);
1722 args = *p_args = newargs;
1739 PyObject *args = *p_args;
1740 Py_ssize_t nargs = PyTuple_GET_SIZE(args);
1763 /* filename, filename2, and winerror are removed from the args tuple
1765 PyObject *subslice = PyTuple_GetSlice(args, 0, 2);
1769 Py_DECREF(args); /* replacing args */
1770 *p_args = args = subslice;
1785 /* Steals the reference to args */
1786 Py_XSETREF(self->args, args);
1787 *p_args = args = NULL;
1793 OSError_new(PyTypeObject *type, PyObject *args, PyObject *kwds);
1795 OSError_init(PyOSErrorObject *self, PyObject *args, PyObject *kwds);
1819 OSError_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
1828 Py_INCREF(args);
1834 if (oserror_parse_args(&args, &myerrno, &strerror,
1864 if (oserror_init(self, &args, myerrno, strerror, filename, filename2
1872 self->args = PyTuple_New(0);
1873 if (self->args == NULL)
1877 Py_XDECREF(args);
1881 Py_XDECREF(args);
1887 OSError_init(PyOSErrorObject *self, PyObject *args, PyObject *kwds)
1902 Py_INCREF(args);
1903 if (oserror_parse_args(&args, &myerrno, &strerror, &filename, &filename2
1910 if (oserror_init(self, &args, myerrno, strerror, filename, filename2
1920 Py_DECREF(args);
2007 PyObject *args = self->args;
2010 /* self->args is only the first two real arguments if there was a
2012 if (PyTuple_GET_SIZE(args) == 2 && self->filename) {
2014 args = PyTuple_New(size);
2015 if (!args)
2018 tmp = PyTuple_GET_ITEM(self->args, 0);
2020 PyTuple_SET_ITEM(args, 0, tmp);
2022 tmp = PyTuple_GET_ITEM(self->args, 1);
2024 PyTuple_SET_ITEM(args, 1, tmp);
2027 PyTuple_SET_ITEM(args, 2, self->filename);
2031 * This tuple is essentially used as OSError(*args).
2036 PyTuple_SET_ITEM(args, 3, Py_None);
2040 PyTuple_SET_ITEM(args, 4, self->filename2);
2043 Py_INCREF(args);
2046 res = PyTuple_Pack(3, Py_TYPE(self), args, self->dict);
2048 res = PyTuple_Pack(2, Py_TYPE(self), args);
2049 Py_DECREF(args);
2181 NameError_init(PyNameErrorObject *self, PyObject *args, PyObject *kwds)
2186 if (BaseException_init((PyBaseExceptionObject *)self, args, NULL) == -1) {
2255 AttributeError_init(PyAttributeErrorObject *self, PyObject *args, PyObject *kwds)
2261 if (BaseException_init((PyBaseExceptionObject *)self, args, NULL) == -1) {
2329 SyntaxError_init(PySyntaxErrorObject *self, PyObject *args, PyObject *kwds)
2332 Py_ssize_t lenargs = PyTuple_GET_SIZE(args);
2334 if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
2338 Py_INCREF(PyTuple_GET_ITEM(args, 0));
2339 Py_XSETREF(self->msg, PyTuple_GET_ITEM(args, 0));
2342 info = PyTuple_GET_ITEM(args, 1);
2544 /* If args is a tuple of exactly one item, apply repr to args[0].
2551 If args is anything else, use the default BaseException__str__().
2553 if (PyTuple_GET_SIZE(self->args) == 1) {
2554 return PyObject_Repr(PyTuple_GET_ITEM(self->args, 0));
2875 UnicodeEncodeError_init(PyObject *self, PyObject *args, PyObject *kwds)
2879 if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
2888 if (!PyArg_ParseTuple(args, "UUnnU",
2973 UnicodeDecodeError_init(PyObject *self, PyObject *args, PyObject *kwds)
2977 if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
2986 if (!PyArg_ParseTuple(args, "UOnnU",
3089 UnicodeTranslateError_init(PyUnicodeErrorObject *self, PyObject *args,
3092 if (BaseException_init((PyBaseExceptionObject *)self, args, kwds) == -1)
3098 if (!PyArg_ParseTuple(args, "UnnU",
3239 MemoryError_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
3246 return BaseException_new(type, args, kwds);
3251 return BaseException_new(type, args, kwds);
3256 self->args = PyTuple_New(0);
3259 if (self->args == NULL) {
3819 /* Check the args are empty or contain a single string */
3821 instance_args = ((PyBaseExceptionObject *)val)->args;