#define _PyArg_NoPositional(funcname, args) \
((args) == NULL || _PyArg_NoPositional((funcname), (args)))
-PyAPI_FUNC(void) _PyArg_BadArgument(const char *, int, const char *, PyObject *);
+PyAPI_FUNC(void) _PyArg_BadArgument(const char *, const char *, const char *, PyObject *);
PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t,
Py_ssize_t, Py_ssize_t);
#define _PyArg_CheckPositional(funcname, nargs, min, max) \
goto exit;
}
if (!PyUnicode_Check(args[2])) {
- _PyArg_BadArgument("test_object_converter", 3, "str", args[2]);
+ _PyArg_BadArgument("test_object_converter", "argument 3", "str", args[2]);
goto exit;
}
c = args[2];
static PyObject *
test_object_converter_impl(PyObject *module, PyObject *a, PyObject *b,
PyObject *c, PyUnicode_Object *d)
-/*[clinic end generated code: output=f2c26174b3d46e94 input=005e6a8a711a869b]*/
+/*[clinic end generated code: output=a78312d933df9ea1 input=005e6a8a711a869b]*/
/*[clinic input]
goto exit;
}
if (!PyLong_Check(args[0])) {
- _PyArg_BadArgument("test_object_converter_subclass_of", 1, "int", args[0]);
+ _PyArg_BadArgument("test_object_converter_subclass_of", "argument 1", "int", args[0]);
goto exit;
}
a = args[0];
if (!PyTuple_Check(args[1])) {
- _PyArg_BadArgument("test_object_converter_subclass_of", 2, "tuple", args[1]);
+ _PyArg_BadArgument("test_object_converter_subclass_of", "argument 2", "tuple", args[1]);
goto exit;
}
b = args[1];
if (!PyList_Check(args[2])) {
- _PyArg_BadArgument("test_object_converter_subclass_of", 3, "list", args[2]);
+ _PyArg_BadArgument("test_object_converter_subclass_of", "argument 3", "list", args[2]);
goto exit;
}
c = args[2];
if (!PySet_Check(args[3])) {
- _PyArg_BadArgument("test_object_converter_subclass_of", 4, "set", args[3]);
+ _PyArg_BadArgument("test_object_converter_subclass_of", "argument 4", "set", args[3]);
goto exit;
}
d = args[3];
if (!PyFrozenSet_Check(args[4])) {
- _PyArg_BadArgument("test_object_converter_subclass_of", 5, "frozenset", args[4]);
+ _PyArg_BadArgument("test_object_converter_subclass_of", "argument 5", "frozenset", args[4]);
goto exit;
}
e = args[4];
if (!PyDict_Check(args[5])) {
- _PyArg_BadArgument("test_object_converter_subclass_of", 6, "dict", args[5]);
+ _PyArg_BadArgument("test_object_converter_subclass_of", "argument 6", "dict", args[5]);
goto exit;
}
f = args[5];
if (!PyUnicode_Check(args[6])) {
- _PyArg_BadArgument("test_object_converter_subclass_of", 7, "str", args[6]);
+ _PyArg_BadArgument("test_object_converter_subclass_of", "argument 7", "str", args[6]);
goto exit;
}
g = args[6];
if (!PyBytes_Check(args[7])) {
- _PyArg_BadArgument("test_object_converter_subclass_of", 8, "bytes", args[7]);
+ _PyArg_BadArgument("test_object_converter_subclass_of", "argument 8", "bytes", args[7]);
goto exit;
}
h = args[7];
if (!PyByteArray_Check(args[8])) {
- _PyArg_BadArgument("test_object_converter_subclass_of", 9, "bytearray", args[8]);
+ _PyArg_BadArgument("test_object_converter_subclass_of", "argument 9", "bytearray", args[8]);
goto exit;
}
i = args[8];
if (!PyObject_TypeCheck(args[9], &MyType)) {
- _PyArg_BadArgument("test_object_converter_subclass_of", 10, (&MyType)->tp_name, args[9]);
+ _PyArg_BadArgument("test_object_converter_subclass_of", "argument 10", (&MyType)->tp_name, args[9]);
goto exit;
}
j = args[9];
PyObject *b, PyObject *c, PyObject *d,
PyObject *e, PyObject *f, PyObject *g,
PyObject *h, PyObject *i, PyObject *j)
-/*[clinic end generated code: output=99691bda8eeda6d6 input=31b06b772d5f983e]*/
+/*[clinic end generated code: output=dcf7772bf0c876dd input=31b06b772d5f983e]*/
/*[clinic input]
PyBytesObject *a;
if (!PyBytes_Check(arg)) {
- _PyArg_BadArgument("test_PyBytesObject_converter", 0, "bytes", arg);
+ _PyArg_BadArgument("test_PyBytesObject_converter", "argument", "bytes", arg);
goto exit;
}
a = (PyBytesObject *)arg;
static PyObject *
test_PyBytesObject_converter_impl(PyObject *module, PyBytesObject *a)
-/*[clinic end generated code: output=5d9a301c1df24eb5 input=12b10c7cb5750400]*/
+/*[clinic end generated code: output=7539d628e6fceace input=12b10c7cb5750400]*/
/*[clinic input]
PyByteArrayObject *a;
if (!PyByteArray_Check(arg)) {
- _PyArg_BadArgument("test_PyByteArrayObject_converter", 0, "bytearray", arg);
+ _PyArg_BadArgument("test_PyByteArrayObject_converter", "argument", "bytearray", arg);
goto exit;
}
a = (PyByteArrayObject *)arg;
static PyObject *
test_PyByteArrayObject_converter_impl(PyObject *module, PyByteArrayObject *a)
-/*[clinic end generated code: output=9455d06f4f09637b input=5a657da535d194ae]*/
+/*[clinic end generated code: output=1245af9f5b3e355e input=5a657da535d194ae]*/
/*[clinic input]
PyObject *a;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("test_unicode_converter", 0, "str", arg);
+ _PyArg_BadArgument("test_unicode_converter", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
static PyObject *
test_unicode_converter_impl(PyObject *module, PyObject *a)
-/*[clinic end generated code: output=9275c04fe204f4c5 input=aa33612df92aa9c5]*/
+/*[clinic end generated code: output=18f1e3880c862611 input=aa33612df92aa9c5]*/
/*[clinic input]
a = PyByteArray_AS_STRING(args[0])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 1, "a byte string of length 1", args[0]);
+ _PyArg_BadArgument("test_char_converter", "argument 1", "a byte string of length 1", args[0]);
goto exit;
}
if (nargs < 2) {
b = PyByteArray_AS_STRING(args[1])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 2, "a byte string of length 1", args[1]);
+ _PyArg_BadArgument("test_char_converter", "argument 2", "a byte string of length 1", args[1]);
goto exit;
}
if (nargs < 3) {
c = PyByteArray_AS_STRING(args[2])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 3, "a byte string of length 1", args[2]);
+ _PyArg_BadArgument("test_char_converter", "argument 3", "a byte string of length 1", args[2]);
goto exit;
}
if (nargs < 4) {
d = PyByteArray_AS_STRING(args[3])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 4, "a byte string of length 1", args[3]);
+ _PyArg_BadArgument("test_char_converter", "argument 4", "a byte string of length 1", args[3]);
goto exit;
}
if (nargs < 5) {
e = PyByteArray_AS_STRING(args[4])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 5, "a byte string of length 1", args[4]);
+ _PyArg_BadArgument("test_char_converter", "argument 5", "a byte string of length 1", args[4]);
goto exit;
}
if (nargs < 6) {
f = PyByteArray_AS_STRING(args[5])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 6, "a byte string of length 1", args[5]);
+ _PyArg_BadArgument("test_char_converter", "argument 6", "a byte string of length 1", args[5]);
goto exit;
}
if (nargs < 7) {
g = PyByteArray_AS_STRING(args[6])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 7, "a byte string of length 1", args[6]);
+ _PyArg_BadArgument("test_char_converter", "argument 7", "a byte string of length 1", args[6]);
goto exit;
}
if (nargs < 8) {
h = PyByteArray_AS_STRING(args[7])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 8, "a byte string of length 1", args[7]);
+ _PyArg_BadArgument("test_char_converter", "argument 8", "a byte string of length 1", args[7]);
goto exit;
}
if (nargs < 9) {
i = PyByteArray_AS_STRING(args[8])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 9, "a byte string of length 1", args[8]);
+ _PyArg_BadArgument("test_char_converter", "argument 9", "a byte string of length 1", args[8]);
goto exit;
}
if (nargs < 10) {
j = PyByteArray_AS_STRING(args[9])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 10, "a byte string of length 1", args[9]);
+ _PyArg_BadArgument("test_char_converter", "argument 10", "a byte string of length 1", args[9]);
goto exit;
}
if (nargs < 11) {
k = PyByteArray_AS_STRING(args[10])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 11, "a byte string of length 1", args[10]);
+ _PyArg_BadArgument("test_char_converter", "argument 11", "a byte string of length 1", args[10]);
goto exit;
}
if (nargs < 12) {
l = PyByteArray_AS_STRING(args[11])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 12, "a byte string of length 1", args[11]);
+ _PyArg_BadArgument("test_char_converter", "argument 12", "a byte string of length 1", args[11]);
goto exit;
}
if (nargs < 13) {
m = PyByteArray_AS_STRING(args[12])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 13, "a byte string of length 1", args[12]);
+ _PyArg_BadArgument("test_char_converter", "argument 13", "a byte string of length 1", args[12]);
goto exit;
}
if (nargs < 14) {
n = PyByteArray_AS_STRING(args[13])[0];
}
else {
- _PyArg_BadArgument("test_char_converter", 14, "a byte string of length 1", args[13]);
+ _PyArg_BadArgument("test_char_converter", "argument 14", "a byte string of length 1", args[13]);
goto exit;
}
skip_optional:
test_char_converter_impl(PyObject *module, char a, char b, char c, char d,
char e, char f, char g, char h, char i, char j,
char k, char l, char m, char n)
-/*[clinic end generated code: output=e041d687555e0a5d input=e42330417a44feac]*/
+/*[clinic end generated code: output=9d3aaf5d6857ec9e input=e42330417a44feac]*/
/*[clinic input]
goto skip_optional;
}
if (!PyUnicode_Check(args[2])) {
- _PyArg_BadArgument("test_int_converter", 3, "a unicode character", args[2]);
+ _PyArg_BadArgument("test_int_converter", "argument 3", "a unicode character", args[2]);
goto exit;
}
if (PyUnicode_READY(args[2])) {
goto exit;
}
if (PyUnicode_GET_LENGTH(args[2]) != 1) {
- _PyArg_BadArgument("test_int_converter", 3, "a unicode character", args[2]);
+ _PyArg_BadArgument("test_int_converter", "argument 3", "a unicode character", args[2]);
goto exit;
}
c = PyUnicode_READ_CHAR(args[2], 0);
static PyObject *
test_int_converter_impl(PyObject *module, int a, int b, int c, myenum d)
-/*[clinic end generated code: output=de74e24e85a669a5 input=d20541fc1ca0553e]*/
+/*[clinic end generated code: output=10a2e48a34af5d7a input=d20541fc1ca0553e]*/
/*[clinic input]
goto skip_optional;
}
if (!PyLong_Check(args[2])) {
- _PyArg_BadArgument("test_unsigned_long_converter", 3, "int", args[2]);
+ _PyArg_BadArgument("test_unsigned_long_converter", "argument 3", "int", args[2]);
goto exit;
}
c = PyLong_AsUnsignedLongMask(args[2]);
static PyObject *
test_unsigned_long_converter_impl(PyObject *module, unsigned long a,
unsigned long b, unsigned long c)
-/*[clinic end generated code: output=1c05c871c0309e08 input=f450d94cae1ef73b]*/
+/*[clinic end generated code: output=87c6b29fa217026e input=f450d94cae1ef73b]*/
/*[clinic input]
goto skip_optional;
}
if (!PyLong_Check(args[2])) {
- _PyArg_BadArgument("test_unsigned_long_long_converter", 3, "int", args[2]);
+ _PyArg_BadArgument("test_unsigned_long_long_converter", "argument 3", "int", args[2]);
goto exit;
}
c = PyLong_AsUnsignedLongLongMask(args[2]);
unsigned long long a,
unsigned long long b,
unsigned long long c)
-/*[clinic end generated code: output=0a9b17fb824e28eb input=a15115dc41866ff4]*/
+/*[clinic end generated code: output=aad2c7b43db2f190 input=a15115dc41866ff4]*/
/*[clinic input]
PyObject *d, PyObject *e,
PyObject *f)
/*[clinic end generated code: output=719e4f6c224402d4 input=9914857713c5bbf8]*/
+
+/*[clinic input]
+test_keyword_only_parameter
+
+
+ *
+ co_lnotab: PyBytesObject(c_default="(PyBytesObject *)self->co_lnotab") = None
+
+[clinic start generated code]*/
+
+PyDoc_STRVAR(test_keyword_only_parameter__doc__,
+"test_keyword_only_parameter($module, /, *, co_lnotab=None)\n"
+"--\n"
+"\n");
+
+#define TEST_KEYWORD_ONLY_PARAMETER_METHODDEF \
+ {"test_keyword_only_parameter", (PyCFunction)(void(*)(void))test_keyword_only_parameter, METH_FASTCALL|METH_KEYWORDS, test_keyword_only_parameter__doc__},
+
+static PyObject *
+test_keyword_only_parameter_impl(PyObject *module, PyBytesObject *co_lnotab);
+
+static PyObject *
+test_keyword_only_parameter(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
+{
+ PyObject *return_value = NULL;
+ static const char * const _keywords[] = {"co_lnotab", NULL};
+ static _PyArg_Parser _parser = {NULL, _keywords, "test_keyword_only_parameter", 0};
+ PyObject *argsbuf[1];
+ Py_ssize_t noptargs = nargs + (kwnames ? PyTuple_GET_SIZE(kwnames) : 0) - 0;
+ PyBytesObject *co_lnotab = (PyBytesObject *)self->co_lnotab;
+
+ args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 0, 0, 0, argsbuf);
+ if (!args) {
+ goto exit;
+ }
+ if (!noptargs) {
+ goto skip_optional_kwonly;
+ }
+ if (!PyBytes_Check(args[0])) {
+ _PyArg_BadArgument("test_keyword_only_parameter", "argument 'co_lnotab'", "bytes", args[0]);
+ goto exit;
+ }
+ co_lnotab = (PyBytesObject *)args[0];
+skip_optional_kwonly:
+ return_value = test_keyword_only_parameter_impl(module, co_lnotab);
+
+exit:
+ return return_value;
+}
+
+static PyObject *
+test_keyword_only_parameter_impl(PyObject *module, PyBytesObject *co_lnotab)
+/*[clinic end generated code: output=f25914b402039493 input=303df5046c7e37a3]*/
self.fail()
except TypeError as e:
self.assertEqual(str(e),
- 'ParserCreate() argument 2 must be str or None, not int')
+ "ParserCreate() argument 'namespace_separator' must be str or None, not int")
try:
expat.ParserCreate(namespace_separator='too long')
--- /dev/null
+Argument Clinic now uses the argument name on errors with keyword-only
+argument instead of their position. Patch contributed by RĂ©mi Lapeyre.
goto exit;
}
if (!PyBuffer_IsContiguous(&key, 'C')) {
- _PyArg_BadArgument("blake2b", 3, "contiguous buffer", fastargs[2]);
+ _PyArg_BadArgument("blake2b", "argument 'key'", "contiguous buffer", fastargs[2]);
goto exit;
}
if (!--noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&salt, 'C')) {
- _PyArg_BadArgument("blake2b", 4, "contiguous buffer", fastargs[3]);
+ _PyArg_BadArgument("blake2b", "argument 'salt'", "contiguous buffer", fastargs[3]);
goto exit;
}
if (!--noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&person, 'C')) {
- _PyArg_BadArgument("blake2b", 5, "contiguous buffer", fastargs[4]);
+ _PyArg_BadArgument("blake2b", "argument 'person'", "contiguous buffer", fastargs[4]);
goto exit;
}
if (!--noptargs) {
{
return _blake2_blake2b_hexdigest_impl(self);
}
-/*[clinic end generated code: output=a91d182ce1109f34 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=cbb625d7f60c288c input=a9049054013a1b77]*/
goto exit;
}
if (!PyBuffer_IsContiguous(&key, 'C')) {
- _PyArg_BadArgument("blake2s", 3, "contiguous buffer", fastargs[2]);
+ _PyArg_BadArgument("blake2s", "argument 'key'", "contiguous buffer", fastargs[2]);
goto exit;
}
if (!--noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&salt, 'C')) {
- _PyArg_BadArgument("blake2s", 4, "contiguous buffer", fastargs[3]);
+ _PyArg_BadArgument("blake2s", "argument 'salt'", "contiguous buffer", fastargs[3]);
goto exit;
}
if (!--noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&person, 'C')) {
- _PyArg_BadArgument("blake2s", 5, "contiguous buffer", fastargs[4]);
+ _PyArg_BadArgument("blake2s", "argument 'person'", "contiguous buffer", fastargs[4]);
goto exit;
}
if (!--noptargs) {
{
return _blake2_blake2s_hexdigest_impl(self);
}
-/*[clinic end generated code: output=ae8e9b7301d092b4 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=39af5a74c8805b36 input=a9049054013a1b77]*/
}
if (args[1]) {
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("open", 2, "str", args[1]);
+ _PyArg_BadArgument("open", "argument 'mode'", "str", args[1]);
goto exit;
}
Py_ssize_t mode_length;
}
}
else {
- _PyArg_BadArgument("open", 4, "str or None", args[3]);
+ _PyArg_BadArgument("open", "argument 'encoding'", "str or None", args[3]);
goto exit;
}
if (!--noptargs) {
}
}
else {
- _PyArg_BadArgument("open", 5, "str or None", args[4]);
+ _PyArg_BadArgument("open", "argument 'errors'", "str or None", args[4]);
goto exit;
}
if (!--noptargs) {
}
}
else {
- _PyArg_BadArgument("open", 6, "str or None", args[5]);
+ _PyArg_BadArgument("open", "argument 'newline'", "str or None", args[5]);
goto exit;
}
if (!--noptargs) {
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("open_code", 1, "str", args[0]);
+ _PyArg_BadArgument("open_code", "argument 'path'", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
exit:
return return_value;
}
-/*[clinic end generated code: output=d479285078750d68 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3df6bc6d91697545 input=a9049054013a1b77]*/
if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
PyErr_Clear();
- _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg);
+ _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _io__BufferedIOBase_readinto_impl(self, &buffer);
if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
PyErr_Clear();
- _PyArg_BadArgument("readinto1", 0, "read-write bytes-like object", arg);
+ _PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg);
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto1", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _io__BufferedIOBase_readinto1_impl(self, &buffer);
if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
PyErr_Clear();
- _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg);
+ _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _io__Buffered_readinto_impl(self, &buffer);
if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
PyErr_Clear();
- _PyArg_BadArgument("readinto1", 0, "read-write bytes-like object", arg);
+ _PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg);
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto1", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _io__Buffered_readinto1_impl(self, &buffer);
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("write", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _io_BufferedWriter_write_impl(self, &buffer);
exit:
return return_value;
}
-/*[clinic end generated code: output=b22b4aedd53c340a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7246104f6c7d3167 input=a9049054013a1b77]*/
if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
PyErr_Clear();
- _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg);
+ _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _io_BytesIO_readinto_impl(self, &buffer);
exit:
return return_value;
}
-/*[clinic end generated code: output=22e8fb54874b6ee5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=4ec2506def9c8eb9 input=a9049054013a1b77]*/
}
if (fastargs[1]) {
if (!PyUnicode_Check(fastargs[1])) {
- _PyArg_BadArgument("FileIO", 2, "str", fastargs[1]);
+ _PyArg_BadArgument("FileIO", "argument 'mode'", "str", fastargs[1]);
goto exit;
}
Py_ssize_t mode_length;
if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
PyErr_Clear();
- _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg);
+ _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _io_FileIO_readinto_impl(self, &buffer);
goto exit;
}
if (!PyBuffer_IsContiguous(&b, 'C')) {
- _PyArg_BadArgument("write", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _io_FileIO_write_impl(self, &b);
#ifndef _IO_FILEIO_TRUNCATE_METHODDEF
#define _IO_FILEIO_TRUNCATE_METHODDEF
#endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */
-/*[clinic end generated code: output=7ee4f3ae584fc6d2 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a7e9cca3613660fb input=a9049054013a1b77]*/
}
}
else {
- _PyArg_BadArgument("TextIOWrapper", 2, "str or None", fastargs[1]);
+ _PyArg_BadArgument("TextIOWrapper", "argument 'encoding'", "str or None", fastargs[1]);
goto exit;
}
if (!--noptargs) {
}
}
else {
- _PyArg_BadArgument("TextIOWrapper", 4, "str or None", fastargs[3]);
+ _PyArg_BadArgument("TextIOWrapper", "argument 'newline'", "str or None", fastargs[3]);
goto exit;
}
if (!--noptargs) {
PyObject *text;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("write", 0, "str", arg);
+ _PyArg_BadArgument("write", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
{
return _io_TextIOWrapper_close_impl(self);
}
-/*[clinic end generated code: output=b651e056e3000f88 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b1bae4f4cdf6019e input=a9049054013a1b77]*/
}
if (fastargs[1]) {
if (!PyUnicode_Check(fastargs[1])) {
- _PyArg_BadArgument("_WindowsConsoleIO", 2, "str", fastargs[1]);
+ _PyArg_BadArgument("_WindowsConsoleIO", "argument 'mode'", "str", fastargs[1]);
goto exit;
}
Py_ssize_t mode_length;
if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) {
PyErr_Clear();
- _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg);
+ _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _io__WindowsConsoleIO_readinto_impl(self, &buffer);
goto exit;
}
if (!PyBuffer_IsContiguous(&b, 'C')) {
- _PyArg_BadArgument("write", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _io__WindowsConsoleIO_write_impl(self, &b);
#ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
#define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
#endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */
-/*[clinic end generated code: output=57bf2c09a42bd330 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f5b8860a658a001a input=a9049054013a1b77]*/
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("shm_open", 1, "str", args[0]);
+ _PyArg_BadArgument("shm_open", "argument 'path'", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("shm_unlink", 1, "str", args[0]);
+ _PyArg_BadArgument("shm_unlink", "argument 'path'", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
#ifndef _POSIXSHMEM_SHM_UNLINK_METHODDEF
#define _POSIXSHMEM_SHM_UNLINK_METHODDEF
#endif /* !defined(_POSIXSHMEM_SHM_UNLINK_METHODDEF) */
-/*[clinic end generated code: output=be42e23c18677c0f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=9132861c61d8c2d8 input=a9049054013a1b77]*/
}
}
else {
- _PyArg_BadArgument("encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("encode", "argument 'errors'", "str or None", args[1]);
goto exit;
}
skip_optional_pos:
goto exit;
}
if (!PyBuffer_IsContiguous(&input, 'C')) {
- _PyArg_BadArgument("decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("decode", "argument 'input'", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
}
}
else {
- _PyArg_BadArgument("decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("decode", "argument 'errors'", "str or None", args[1]);
goto exit;
}
skip_optional_pos:
PyLongObject *statelong;
if (!PyLong_Check(arg)) {
- _PyArg_BadArgument("setstate", 0, "int", arg);
+ _PyArg_BadArgument("setstate", "argument", "int", arg);
goto exit;
}
statelong = (PyLongObject *)arg;
goto exit;
}
if (!PyBuffer_IsContiguous(&input, 'C')) {
- _PyArg_BadArgument("decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("decode", "argument 'input'", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
PyObject *state;
if (!PyTuple_Check(arg)) {
- _PyArg_BadArgument("setstate", 0, "tuple", arg);
+ _PyArg_BadArgument("setstate", "argument", "tuple", arg);
goto exit;
}
state = arg;
#define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \
{"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
-/*[clinic end generated code: output=eb95a408c4ddbfff input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5ce6fd4ca1f95620 input=a9049054013a1b77]*/
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("compress", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("compress", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _bz2_BZ2Compressor_compress_impl(self, &data);
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("decompress", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("decompress", "argument 'data'", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
exit:
return return_value;
}
-/*[clinic end generated code: output=8e123f4eec497655 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ec3d1b3652c98823 input=a9049054013a1b77]*/
const char *encoding;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("lookup", 0, "str", arg);
+ _PyArg_BadArgument("lookup", "argument", "str", arg);
goto exit;
}
Py_ssize_t encoding_length;
}
if (args[1]) {
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("encode", 2, "str", args[1]);
+ _PyArg_BadArgument("encode", "argument 'encoding'", "str", args[1]);
goto exit;
}
Py_ssize_t encoding_length;
}
}
if (!PyUnicode_Check(args[2])) {
- _PyArg_BadArgument("encode", 3, "str", args[2]);
+ _PyArg_BadArgument("encode", "argument 'errors'", "str", args[2]);
goto exit;
}
Py_ssize_t errors_length;
}
if (args[1]) {
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("decode", 2, "str", args[1]);
+ _PyArg_BadArgument("decode", "argument 'encoding'", "str", args[1]);
goto exit;
}
Py_ssize_t encoding_length;
}
}
if (!PyUnicode_Check(args[2])) {
- _PyArg_BadArgument("decode", 3, "str", args[2]);
+ _PyArg_BadArgument("decode", "argument 'errors'", "str", args[2]);
goto exit;
}
Py_ssize_t errors_length;
const char *encoding;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("_forget_codec", 0, "str", arg);
+ _PyArg_BadArgument("_forget_codec", "argument", "str", arg);
goto exit;
}
Py_ssize_t encoding_length;
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("escape_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("escape_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
}
}
}
else {
- _PyArg_BadArgument("escape_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("escape_decode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyBytes_Check(args[0])) {
- _PyArg_BadArgument("escape_encode", 1, "bytes", args[0]);
+ _PyArg_BadArgument("escape_encode", "argument 1", "bytes", args[0]);
goto exit;
}
data = args[0];
}
}
else {
- _PyArg_BadArgument("escape_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("escape_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_7_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("utf_7_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("utf_7_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_7_decode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_8_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("utf_8_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("utf_8_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_8_decode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_16_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("utf_16_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("utf_16_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_16_decode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_16_le_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("utf_16_le_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("utf_16_le_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_16_le_decode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_16_be_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("utf_16_be_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("utf_16_be_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_16_be_decode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_16_ex_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("utf_16_ex_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("utf_16_ex_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_16_ex_decode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_32_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("utf_32_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("utf_32_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_32_decode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_32_le_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("utf_32_le_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("utf_32_le_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_32_le_decode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_32_be_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("utf_32_be_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("utf_32_be_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_32_be_decode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_32_ex_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("utf_32_ex_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("utf_32_ex_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_32_ex_decode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("unicode_escape_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("unicode_escape_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
}
}
}
else {
- _PyArg_BadArgument("unicode_escape_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("unicode_escape_decode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("raw_unicode_escape_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("raw_unicode_escape_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
}
}
}
else {
- _PyArg_BadArgument("raw_unicode_escape_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("raw_unicode_escape_decode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("latin_1_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("latin_1_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("latin_1_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("latin_1_decode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("ascii_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("ascii_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("ascii_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("ascii_decode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("charmap_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("charmap_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("charmap_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("charmap_decode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("mbcs_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("mbcs_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("mbcs_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("mbcs_decode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("oem_decode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("oem_decode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
}
}
else {
- _PyArg_BadArgument("oem_decode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("oem_decode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("code_page_decode", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("code_page_decode", "argument 2", "contiguous buffer", args[1]);
goto exit;
}
if (nargs < 3) {
}
}
else {
- _PyArg_BadArgument("code_page_decode", 3, "str or None", args[2]);
+ _PyArg_BadArgument("code_page_decode", "argument 3", "str or None", args[2]);
goto exit;
}
if (nargs < 4) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("readbuffer_encode", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("readbuffer_encode", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
}
}
}
else {
- _PyArg_BadArgument("readbuffer_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("readbuffer_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("utf_7_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("utf_7_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("utf_7_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_7_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("utf_8_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("utf_8_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("utf_8_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_8_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("utf_16_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("utf_16_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("utf_16_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_16_encode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("utf_16_le_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("utf_16_le_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("utf_16_le_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_16_le_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("utf_16_be_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("utf_16_be_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("utf_16_be_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_16_be_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("utf_32_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("utf_32_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("utf_32_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_32_encode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("utf_32_le_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("utf_32_le_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("utf_32_le_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_32_le_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("utf_32_be_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("utf_32_be_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("utf_32_be_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("utf_32_be_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("unicode_escape_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("unicode_escape_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("unicode_escape_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("unicode_escape_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("raw_unicode_escape_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("raw_unicode_escape_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("raw_unicode_escape_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("raw_unicode_escape_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("latin_1_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("latin_1_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("latin_1_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("latin_1_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("ascii_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("ascii_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("ascii_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("ascii_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("charmap_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("charmap_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("charmap_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("charmap_encode", "argument 2", "str or None", args[1]);
goto exit;
}
if (nargs < 3) {
PyObject *map;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("charmap_build", 0, "str", arg);
+ _PyArg_BadArgument("charmap_build", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("mbcs_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("mbcs_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("mbcs_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("mbcs_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("oem_encode", 1, "str", args[0]);
+ _PyArg_BadArgument("oem_encode", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
}
else {
- _PyArg_BadArgument("oem_encode", 2, "str or None", args[1]);
+ _PyArg_BadArgument("oem_encode", "argument 2", "str or None", args[1]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("code_page_encode", 2, "str", args[1]);
+ _PyArg_BadArgument("code_page_encode", "argument 2", "str", args[1]);
goto exit;
}
if (PyUnicode_READY(args[1]) == -1) {
}
}
else {
- _PyArg_BadArgument("code_page_encode", 3, "str or None", args[2]);
+ _PyArg_BadArgument("code_page_encode", "argument 3", "str or None", args[2]);
goto exit;
}
skip_optional:
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("register_error", 1, "str", args[0]);
+ _PyArg_BadArgument("register_error", "argument 1", "str", args[0]);
goto exit;
}
Py_ssize_t errors_length;
const char *name;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("lookup_error", 0, "str", arg);
+ _PyArg_BadArgument("lookup_error", "argument", "str", arg);
goto exit;
}
Py_ssize_t name_length;
#ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF
#define _CODECS_CODE_PAGE_ENCODE_METHODDEF
#endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */
-/*[clinic end generated code: output=da3c47709a55a05e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=59726a305e4ec24a input=a9049054013a1b77]*/
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("crypt", 1, "str", args[0]);
+ _PyArg_BadArgument("crypt", "argument 1", "str", args[0]);
goto exit;
}
Py_ssize_t word_length;
goto exit;
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("crypt", 2, "str", args[1]);
+ _PyArg_BadArgument("crypt", "argument 2", "str", args[1]);
goto exit;
}
Py_ssize_t salt_length;
exit:
return return_value;
}
-/*[clinic end generated code: output=3f75d4d4be4dddbb input=a9049054013a1b77]*/
+/*[clinic end generated code: output=549de0d43b030126 input=a9049054013a1b77]*/
PyCursesWindowObject *win;
if (!PyObject_TypeCheck(arg, &PyCursesWindow_Type)) {
- _PyArg_BadArgument("replace", 0, (&PyCursesWindow_Type)->tp_name, arg);
+ _PyArg_BadArgument("replace", "argument", (&PyCursesWindow_Type)->tp_name, arg);
goto exit;
}
win = (PyCursesWindowObject *)arg;
PyCursesWindowObject *win;
if (!PyObject_TypeCheck(arg, &PyCursesWindow_Type)) {
- _PyArg_BadArgument("new_panel", 0, (&PyCursesWindow_Type)->tp_name, arg);
+ _PyArg_BadArgument("new_panel", "argument", (&PyCursesWindow_Type)->tp_name, arg);
goto exit;
}
win = (PyCursesWindowObject *)arg;
{
return _curses_panel_update_panels_impl(module);
}
-/*[clinic end generated code: output=3cc16062281b7e07 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d96dc1fd68e898d9 input=a9049054013a1b77]*/
goto exit;
}
if (!PyLong_Check(args[4])) {
- _PyArg_BadArgument("ungetmouse", 5, "int", args[4]);
+ _PyArg_BadArgument("ungetmouse", "argument 5", "int", args[4]);
goto exit;
}
bstate = PyLong_AsUnsignedLongMask(args[4]);
}
}
else {
- _PyArg_BadArgument("setupterm", 1, "str or None", args[0]);
+ _PyArg_BadArgument("setupterm", "argument 'term'", "str or None", args[0]);
goto exit;
}
if (!--noptargs) {
unsigned long newmask;
if (!PyLong_Check(arg)) {
- _PyArg_BadArgument("mousemask", 0, "int", arg);
+ _PyArg_BadArgument("mousemask", "argument", "int", arg);
goto exit;
}
newmask = PyLong_AsUnsignedLongMask(arg);
const char *capname;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("tigetflag", 0, "str", arg);
+ _PyArg_BadArgument("tigetflag", "argument", "str", arg);
goto exit;
}
Py_ssize_t capname_length;
const char *capname;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("tigetnum", 0, "str", arg);
+ _PyArg_BadArgument("tigetnum", "argument", "str", arg);
goto exit;
}
Py_ssize_t capname_length;
const char *capname;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("tigetstr", 0, "str", arg);
+ _PyArg_BadArgument("tigetstr", "argument", "str", arg);
goto exit;
}
Py_ssize_t capname_length;
#ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF
#define _CURSES_USE_DEFAULT_COLORS_METHODDEF
#endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */
-/*[clinic end generated code: output=1350eeb0c1e06af6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e5b3502f1d38dff0 input=a9049054013a1b77]*/
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("open", 1, "str", args[0]);
+ _PyArg_BadArgument("open", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
goto skip_optional;
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("open", 2, "str", args[1]);
+ _PyArg_BadArgument("open", "argument 2", "str", args[1]);
goto exit;
}
Py_ssize_t flags_length;
exit:
return return_value;
}
-/*[clinic end generated code: output=7f5d30ef5d820b8a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7ced103488cbca7a input=a9049054013a1b77]*/
PyObject *subelement;
if (!PyObject_TypeCheck(arg, &Element_Type)) {
- _PyArg_BadArgument("append", 0, (&Element_Type)->tp_name, arg);
+ _PyArg_BadArgument("append", "argument", (&Element_Type)->tp_name, arg);
goto exit;
}
subelement = arg;
PyObject *memo;
if (!PyDict_Check(arg)) {
- _PyArg_BadArgument("__deepcopy__", 0, "dict", arg);
+ _PyArg_BadArgument("__deepcopy__", "argument", "dict", arg);
goto exit;
}
memo = arg;
index = ival;
}
if (!PyObject_TypeCheck(args[1], &Element_Type)) {
- _PyArg_BadArgument("insert", 2, (&Element_Type)->tp_name, args[1]);
+ _PyArg_BadArgument("insert", "argument 2", (&Element_Type)->tp_name, args[1]);
goto exit;
}
subelement = args[1];
PyObject *subelement;
if (!PyObject_TypeCheck(arg, &Element_Type)) {
- _PyArg_BadArgument("remove", 0, (&Element_Type)->tp_name, arg);
+ _PyArg_BadArgument("remove", "argument", (&Element_Type)->tp_name, arg);
goto exit;
}
subelement = arg;
}
}
else {
- _PyArg_BadArgument("XMLParser", 2, "str or None", fastargs[1]);
+ _PyArg_BadArgument("XMLParser", "argument 'encoding'", "str or None", fastargs[1]);
goto exit;
}
skip_optional_kwonly:
exit:
return return_value;
}
-/*[clinic end generated code: output=386a68425d072b5c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=50e0b1954c5f9e0f input=a9049054013a1b77]*/
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("open", 1, "str", args[0]);
+ _PyArg_BadArgument("open", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
goto skip_optional;
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("open", 2, "str", args[1]);
+ _PyArg_BadArgument("open", "argument 2", "str", args[1]);
goto exit;
}
Py_ssize_t flags_length;
exit:
return return_value;
}
-/*[clinic end generated code: output=0a72598e5a3acd60 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2766471b2fa1a816 input=a9049054013a1b77]*/
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("pbkdf2_hmac", 1, "str", args[0]);
+ _PyArg_BadArgument("pbkdf2_hmac", "argument 'hash_name'", "str", args[0]);
goto exit;
}
Py_ssize_t hash_name_length;
goto exit;
}
if (!PyBuffer_IsContiguous(&password, 'C')) {
- _PyArg_BadArgument("pbkdf2_hmac", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("pbkdf2_hmac", "argument 'password'", "contiguous buffer", args[1]);
goto exit;
}
if (PyObject_GetBuffer(args[2], &salt, PyBUF_SIMPLE) != 0) {
goto exit;
}
if (!PyBuffer_IsContiguous(&salt, 'C')) {
- _PyArg_BadArgument("pbkdf2_hmac", 3, "contiguous buffer", args[2]);
+ _PyArg_BadArgument("pbkdf2_hmac", "argument 'salt'", "contiguous buffer", args[2]);
goto exit;
}
if (PyFloat_Check(args[3])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&password, 'C')) {
- _PyArg_BadArgument("scrypt", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("scrypt", "argument 'password'", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&salt, 'C')) {
- _PyArg_BadArgument("scrypt", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("scrypt", "argument 'salt'", "contiguous buffer", args[1]);
goto exit;
}
if (!--noptargs) {
}
if (args[2]) {
if (!PyLong_Check(args[2])) {
- _PyArg_BadArgument("scrypt", 3, "int", args[2]);
+ _PyArg_BadArgument("scrypt", "argument 'n'", "int", args[2]);
goto exit;
}
n_obj = args[2];
}
if (args[3]) {
if (!PyLong_Check(args[3])) {
- _PyArg_BadArgument("scrypt", 4, "int", args[3]);
+ _PyArg_BadArgument("scrypt", "argument 'r'", "int", args[3]);
goto exit;
}
r_obj = args[3];
}
if (args[4]) {
if (!PyLong_Check(args[4])) {
- _PyArg_BadArgument("scrypt", 5, "int", args[4]);
+ _PyArg_BadArgument("scrypt", "argument 'p'", "int", args[4]);
goto exit;
}
p_obj = args[4];
goto exit;
}
if (!PyBuffer_IsContiguous(&key, 'C')) {
- _PyArg_BadArgument("hmac_digest", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("hmac_digest", "argument 'key'", "contiguous buffer", args[0]);
goto exit;
}
if (PyObject_GetBuffer(args[1], &msg, PyBUF_SIMPLE) != 0) {
goto exit;
}
if (!PyBuffer_IsContiguous(&msg, 'C')) {
- _PyArg_BadArgument("hmac_digest", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("hmac_digest", "argument 'msg'", "contiguous buffer", args[1]);
goto exit;
}
if (!PyUnicode_Check(args[2])) {
- _PyArg_BadArgument("hmac_digest", 3, "str", args[2]);
+ _PyArg_BadArgument("hmac_digest", "argument 'digest'", "str", args[2]);
goto exit;
}
Py_ssize_t digest_length;
#ifndef _HASHLIB_SCRYPT_METHODDEF
#define _HASHLIB_SCRYPT_METHODDEF
#endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */
-/*[clinic end generated code: output=5955ec791260045a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=565dcbe3452e71f4 input=a9049054013a1b77]*/
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("compress", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("compress", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _lzma_LZMACompressor_compress_impl(self, &data);
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("decompress", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("decompress", "argument 'data'", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&encoded_props, 'C')) {
- _PyArg_BadArgument("_decode_filter_properties", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("_decode_filter_properties", "argument 2", "contiguous buffer", args[1]);
goto exit;
}
return_value = _lzma__decode_filter_properties_impl(module, filter_id, &encoded_props);
return return_value;
}
-/*[clinic end generated code: output=1a290aa478603107 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f7477a10e86a717d input=a9049054013a1b77]*/
}
if (fastargs[2]) {
if (!PyUnicode_Check(fastargs[2])) {
- _PyArg_BadArgument("Unpickler", 3, "str", fastargs[2]);
+ _PyArg_BadArgument("Unpickler", "argument 'encoding'", "str", fastargs[2]);
goto exit;
}
Py_ssize_t encoding_length;
}
if (fastargs[3]) {
if (!PyUnicode_Check(fastargs[3])) {
- _PyArg_BadArgument("Unpickler", 4, "str", fastargs[3]);
+ _PyArg_BadArgument("Unpickler", "argument 'errors'", "str", fastargs[3]);
goto exit;
}
Py_ssize_t errors_length;
}
if (args[2]) {
if (!PyUnicode_Check(args[2])) {
- _PyArg_BadArgument("load", 3, "str", args[2]);
+ _PyArg_BadArgument("load", "argument 'encoding'", "str", args[2]);
goto exit;
}
Py_ssize_t encoding_length;
}
if (args[3]) {
if (!PyUnicode_Check(args[3])) {
- _PyArg_BadArgument("load", 4, "str", args[3]);
+ _PyArg_BadArgument("load", "argument 'errors'", "str", args[3]);
goto exit;
}
Py_ssize_t errors_length;
}
if (args[2]) {
if (!PyUnicode_Check(args[2])) {
- _PyArg_BadArgument("loads", 3, "str", args[2]);
+ _PyArg_BadArgument("loads", "argument 'encoding'", "str", args[2]);
goto exit;
}
Py_ssize_t encoding_length;
}
if (args[3]) {
if (!PyUnicode_Check(args[3])) {
- _PyArg_BadArgument("loads", 4, "str", args[3]);
+ _PyArg_BadArgument("loads", "argument 'errors'", "str", args[3]);
goto exit;
}
Py_ssize_t errors_length;
exit:
return return_value;
}
-/*[clinic end generated code: output=8dc0e862f96c4afe input=a9049054013a1b77]*/
+/*[clinic end generated code: output=17f6a76ebd94325d input=a9049054013a1b77]*/
goto exit;
}
if (!PyList_Check(args[2])) {
- _PyArg_BadArgument("compile", 3, "list", args[2]);
+ _PyArg_BadArgument("compile", "argument 'code'", "list", args[2]);
goto exit;
}
code = args[2];
groups = ival;
}
if (!PyDict_Check(args[4])) {
- _PyArg_BadArgument("compile", 5, "dict", args[4]);
+ _PyArg_BadArgument("compile", "argument 'groupindex'", "dict", args[4]);
goto exit;
}
groupindex = args[4];
if (!PyTuple_Check(args[5])) {
- _PyArg_BadArgument("compile", 6, "tuple", args[5]);
+ _PyArg_BadArgument("compile", "argument 'indexgroup'", "tuple", args[5]);
goto exit;
}
indexgroup = args[5];
{
return _sre_SRE_Scanner_search_impl(self);
}
-/*[clinic end generated code: output=67b702da5bdc9cac input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1adeddce58ae284c input=a9049054013a1b77]*/
goto exit;
}
if (!PyBuffer_IsContiguous(&b, 'C')) {
- _PyArg_BadArgument("write", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _ssl__SSLSocket_write_impl(self, &b);
goto skip_optional_pos;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("get_channel_binding", 1, "str", args[0]);
+ _PyArg_BadArgument("get_channel_binding", "argument 'cb_type'", "str", args[0]);
goto exit;
}
Py_ssize_t cb_type_length;
const char *cipherlist;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("set_ciphers", 0, "str", arg);
+ _PyArg_BadArgument("set_ciphers", "argument", "str", arg);
goto exit;
}
Py_ssize_t cipherlist_length;
goto exit;
}
if (!PyBuffer_IsContiguous(&protos, 'C')) {
- _PyArg_BadArgument("_set_npn_protocols", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("_set_npn_protocols", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _ssl__SSLContext__set_npn_protocols_impl(self, &protos);
goto exit;
}
if (!PyBuffer_IsContiguous(&protos, 'C')) {
- _PyArg_BadArgument("_set_alpn_protocols", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("_set_alpn_protocols", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _ssl__SSLContext__set_alpn_protocols_impl(self, &protos);
goto exit;
}
if (!PyObject_TypeCheck(args[0], PySocketModule.Sock_Type)) {
- _PyArg_BadArgument("_wrap_socket", 1, (PySocketModule.Sock_Type)->tp_name, args[0]);
+ _PyArg_BadArgument("_wrap_socket", "argument 'sock'", (PySocketModule.Sock_Type)->tp_name, args[0]);
goto exit;
}
sock = args[0];
goto exit;
}
if (!PyObject_TypeCheck(args[0], &PySSLMemoryBIO_Type)) {
- _PyArg_BadArgument("_wrap_bio", 1, (&PySSLMemoryBIO_Type)->tp_name, args[0]);
+ _PyArg_BadArgument("_wrap_bio", "argument 'incoming'", (&PySSLMemoryBIO_Type)->tp_name, args[0]);
goto exit;
}
incoming = (PySSLMemoryBIO *)args[0];
if (!PyObject_TypeCheck(args[1], &PySSLMemoryBIO_Type)) {
- _PyArg_BadArgument("_wrap_bio", 2, (&PySSLMemoryBIO_Type)->tp_name, args[1]);
+ _PyArg_BadArgument("_wrap_bio", "argument 'outgoing'", (&PySSLMemoryBIO_Type)->tp_name, args[1]);
goto exit;
}
outgoing = (PySSLMemoryBIO *)args[1];
goto exit;
}
if (!PyBuffer_IsContiguous(&b, 'C')) {
- _PyArg_BadArgument("write", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = _ssl_MemoryBIO_write_impl(self, &b);
goto exit;
}
if (!PyBuffer_IsContiguous(&view, 'C')) {
- _PyArg_BadArgument("RAND_add", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("RAND_add", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
}
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("txt2obj", 1, "str", args[0]);
+ _PyArg_BadArgument("txt2obj", "argument 'txt'", "str", args[0]);
goto exit;
}
Py_ssize_t txt_length;
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("enum_certificates", 1, "str", args[0]);
+ _PyArg_BadArgument("enum_certificates", "argument 'store_name'", "str", args[0]);
goto exit;
}
Py_ssize_t store_name_length;
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("enum_crls", 1, "str", args[0]);
+ _PyArg_BadArgument("enum_crls", "argument 'store_name'", "str", args[0]);
goto exit;
}
Py_ssize_t store_name_length;
#ifndef _SSL_ENUM_CRLS_METHODDEF
#define _SSL_ENUM_CRLS_METHODDEF
#endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */
-/*[clinic end generated code: output=5003112e167cd948 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=aa4947067c3fef2d input=a9049054013a1b77]*/
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("unpack", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("unpack", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = Struct_unpack_impl(self, &buffer);
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("unpack_from", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("unpack_from", "argument 'buffer'", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("unpack", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("unpack", "argument 2", "contiguous buffer", args[1]);
goto exit;
}
return_value = unpack_impl(module, s_object, &buffer);
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("unpack_from", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("unpack_from", "argument 'buffer'", "contiguous buffer", args[1]);
goto exit;
}
if (!noptargs) {
return return_value;
}
-/*[clinic end generated code: output=b642e1002d25ebdd input=a9049054013a1b77]*/
+/*[clinic end generated code: output=6a6228cfc4b7099c input=a9049054013a1b77]*/
const char *script;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("eval", 0, "str", arg);
+ _PyArg_BadArgument("eval", "argument", "str", arg);
goto exit;
}
Py_ssize_t script_length;
const char *fileName;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("evalfile", 0, "str", arg);
+ _PyArg_BadArgument("evalfile", "argument", "str", arg);
goto exit;
}
Py_ssize_t fileName_length;
const char *script;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("record", 0, "str", arg);
+ _PyArg_BadArgument("record", "argument", "str", arg);
goto exit;
}
Py_ssize_t script_length;
const char *msg;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("adderrorinfo", 0, "str", arg);
+ _PyArg_BadArgument("adderrorinfo", "argument", "str", arg);
goto exit;
}
Py_ssize_t msg_length;
const char *s;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("exprstring", 0, "str", arg);
+ _PyArg_BadArgument("exprstring", "argument", "str", arg);
goto exit;
}
Py_ssize_t s_length;
const char *s;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("exprlong", 0, "str", arg);
+ _PyArg_BadArgument("exprlong", "argument", "str", arg);
goto exit;
}
Py_ssize_t s_length;
const char *s;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("exprdouble", 0, "str", arg);
+ _PyArg_BadArgument("exprdouble", "argument", "str", arg);
goto exit;
}
Py_ssize_t s_length;
const char *s;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("exprboolean", 0, "str", arg);
+ _PyArg_BadArgument("exprboolean", "argument", "str", arg);
goto exit;
}
Py_ssize_t s_length;
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("createcommand", 1, "str", args[0]);
+ _PyArg_BadArgument("createcommand", "argument 1", "str", args[0]);
goto exit;
}
Py_ssize_t name_length;
const char *name;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("deletecommand", 0, "str", arg);
+ _PyArg_BadArgument("deletecommand", "argument", "str", arg);
goto exit;
}
Py_ssize_t name_length;
}
}
else {
- _PyArg_BadArgument("create", 1, "str or None", args[0]);
+ _PyArg_BadArgument("create", "argument 1", "str or None", args[0]);
goto exit;
}
if (nargs < 2) {
goto skip_optional;
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("create", 2, "str", args[1]);
+ _PyArg_BadArgument("create", "argument 2", "str", args[1]);
goto exit;
}
Py_ssize_t baseName_length;
goto skip_optional;
}
if (!PyUnicode_Check(args[2])) {
- _PyArg_BadArgument("create", 3, "str", args[2]);
+ _PyArg_BadArgument("create", "argument 3", "str", args[2]);
goto exit;
}
Py_ssize_t className_length;
}
}
else {
- _PyArg_BadArgument("create", 8, "str or None", args[7]);
+ _PyArg_BadArgument("create", "argument 8", "str or None", args[7]);
goto exit;
}
skip_optional:
#ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
#define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
#endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */
-/*[clinic end generated code: output=2cf95f0101f3dbca input=a9049054013a1b77]*/
+/*[clinic end generated code: output=da0115c470aac1c0 input=a9049054013a1b77]*/
goto exit;
}
if (!PyDict_Check(args[0])) {
- _PyArg_BadArgument("_remove_dead_weakref", 1, "dict", args[0]);
+ _PyArg_BadArgument("_remove_dead_weakref", "argument 1", "dict", args[0]);
goto exit;
}
dct = args[0];
exit:
return return_value;
}
-/*[clinic end generated code: output=eae22e2d2e43120e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c543dc2cd6ece975 input=a9049054013a1b77]*/
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("fromstring", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("fromstring", "argument", "contiguous buffer", arg);
goto exit;
}
}
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("frombytes", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("frombytes", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = array_array_frombytes_impl(self, &buffer);
}
arraytype = (PyTypeObject *)args[0];
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("_array_reconstructor", 2, "a unicode character", args[1]);
+ _PyArg_BadArgument("_array_reconstructor", "argument 2", "a unicode character", args[1]);
goto exit;
}
if (PyUnicode_READY(args[1])) {
goto exit;
}
if (PyUnicode_GET_LENGTH(args[1]) != 1) {
- _PyArg_BadArgument("_array_reconstructor", 2, "a unicode character", args[1]);
+ _PyArg_BadArgument("_array_reconstructor", "argument 2", "a unicode character", args[1]);
goto exit;
}
typecode = PyUnicode_READ_CHAR(args[1], 0);
#define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \
{"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__},
-/*[clinic end generated code: output=c9a40f11f1a866fb input=a9049054013a1b77]*/
+/*[clinic end generated code: output=6aa421571e2c0756 input=a9049054013a1b77]*/
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("getsample", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("getsample", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("max", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("max", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("minmax", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("minmax", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("avg", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("avg", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("rms", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("rms", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("findfit", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("findfit", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyObject_GetBuffer(args[1], &reference, PyBUF_SIMPLE) != 0) {
goto exit;
}
if (!PyBuffer_IsContiguous(&reference, 'C')) {
- _PyArg_BadArgument("findfit", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("findfit", "argument 2", "contiguous buffer", args[1]);
goto exit;
}
return_value = audioop_findfit_impl(module, &fragment, &reference);
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("findfactor", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("findfactor", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyObject_GetBuffer(args[1], &reference, PyBUF_SIMPLE) != 0) {
goto exit;
}
if (!PyBuffer_IsContiguous(&reference, 'C')) {
- _PyArg_BadArgument("findfactor", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("findfactor", "argument 2", "contiguous buffer", args[1]);
goto exit;
}
return_value = audioop_findfactor_impl(module, &fragment, &reference);
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("findmax", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("findmax", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("avgpp", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("avgpp", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("maxpp", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("maxpp", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("cross", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("cross", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("mul", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("mul", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("tomono", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("tomono", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("tostereo", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("tostereo", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment1, 'C')) {
- _PyArg_BadArgument("add", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("add", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyObject_GetBuffer(args[1], &fragment2, PyBUF_SIMPLE) != 0) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment2, 'C')) {
- _PyArg_BadArgument("add", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("add", "argument 2", "contiguous buffer", args[1]);
goto exit;
}
if (PyFloat_Check(args[2])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("bias", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("bias", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("reverse", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("reverse", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("byteswap", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("byteswap", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("lin2lin", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("lin2lin", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("ratecv", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("ratecv", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("lin2ulaw", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("lin2ulaw", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("ulaw2lin", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("ulaw2lin", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("lin2alaw", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("lin2alaw", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("alaw2lin", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("alaw2lin", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("lin2adpcm", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("lin2adpcm", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&fragment, 'C')) {
- _PyArg_BadArgument("adpcm2lin", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("adpcm2lin", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
return return_value;
}
-/*[clinic end generated code: output=af32f4bce9c934fa input=a9049054013a1b77]*/
+/*[clinic end generated code: output=6b4f2c597f295abc input=a9049054013a1b77]*/
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("b2a_uu", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("b2a_uu", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("b2a_base64", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("b2a_base64", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("rlecode_hqx", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("rlecode_hqx", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = binascii_rlecode_hqx_impl(module, &data);
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("b2a_hqx", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("b2a_hqx", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = binascii_b2a_hqx_impl(module, &data);
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("rledecode_hqx", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("rledecode_hqx", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = binascii_rledecode_hqx_impl(module, &data);
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("crc_hqx", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("crc_hqx", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyFloat_Check(args[1])) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("crc32", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("crc32", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("b2a_hex", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("b2a_hex", "argument 'data'", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("hexlify", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("hexlify", "argument 'data'", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("b2a_qp", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("b2a_qp", "argument 'data'", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
return return_value;
}
-/*[clinic end generated code: output=f7b8049edb130c63 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e13bd02ac40496f0 input=a9049054013a1b77]*/
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("getgrnam", 1, "str", args[0]);
+ _PyArg_BadArgument("getgrnam", "argument 'name'", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
{
return grp_getgrall_impl(module);
}
-/*[clinic end generated code: output=2aa6c60873d41ee8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=9b3f26779e4e1a52 input=a9049054013a1b77]*/
goto exit;
}
if (!PyObject_TypeCheck(PyTuple_GET_ITEM(args, 0), &groupby_type)) {
- _PyArg_BadArgument("_grouper", 1, (&groupby_type)->tp_name, PyTuple_GET_ITEM(args, 0));
+ _PyArg_BadArgument("_grouper", "argument 1", (&groupby_type)->tp_name, PyTuple_GET_ITEM(args, 0));
goto exit;
}
parent = PyTuple_GET_ITEM(args, 0);
}
it = PyTuple_GET_ITEM(args, 0);
if (!PyList_Check(PyTuple_GET_ITEM(args, 1))) {
- _PyArg_BadArgument("teedataobject", 2, "list", PyTuple_GET_ITEM(args, 1));
+ _PyArg_BadArgument("teedataobject", "argument 2", "list", PyTuple_GET_ITEM(args, 1));
goto exit;
}
values = PyTuple_GET_ITEM(args, 1);
exit:
return return_value;
}
-/*[clinic end generated code: output=04c49debcae96003 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=392c9706e79f6710 input=a9049054013a1b77]*/
goto exit;
}
if (!PyLong_Check(args[1])) {
- _PyArg_BadArgument("chflags", 2, "int", args[1]);
+ _PyArg_BadArgument("chflags", "argument 'flags'", "int", args[1]);
goto exit;
}
flags = PyLong_AsUnsignedLongMask(args[1]);
goto exit;
}
if (!PyLong_Check(args[1])) {
- _PyArg_BadArgument("lchflags", 2, "int", args[1]);
+ _PyArg_BadArgument("lchflags", "argument 'flags'", "int", args[1]);
goto exit;
}
flags = PyLong_AsUnsignedLongMask(args[1]);
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("write", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("write", "argument 2", "contiguous buffer", args[1]);
goto exit;
}
_return_value = os_write_impl(module, fd, &data);
goto exit;
}
if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("pwrite", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("pwrite", "argument 2", "contiguous buffer", args[1]);
goto exit;
}
if (!Py_off_t_converter(args[2], &offset)) {
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("putenv", 1, "str", args[0]);
+ _PyArg_BadArgument("putenv", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
name = args[0];
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("putenv", 2, "str", args[1]);
+ _PyArg_BadArgument("putenv", "argument 2", "str", args[1]);
goto exit;
}
if (PyUnicode_READY(args[1]) == -1) {
goto exit;
}
if (!PyBuffer_IsContiguous(&value, 'C')) {
- _PyArg_BadArgument("setxattr", 3, "contiguous buffer", args[2]);
+ _PyArg_BadArgument("setxattr", "argument 'value'", "contiguous buffer", args[2]);
goto exit;
}
if (!noptargs) {
#ifndef OS__REMOVE_DLL_DIRECTORY_METHODDEF
#define OS__REMOVE_DLL_DIRECTORY_METHODDEF
#endif /* !defined(OS__REMOVE_DLL_DIRECTORY_METHODDEF) */
-/*[clinic end generated code: output=366a1de4c9c61a30 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ba6bac1702f55dbb input=a9049054013a1b77]*/
PyObject *name;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("getpwnam", 0, "str", arg);
+ _PyArg_BadArgument("getpwnam", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
#ifndef PWD_GETPWALL_METHODDEF
#define PWD_GETPWALL_METHODDEF
#endif /* !defined(PWD_GETPWALL_METHODDEF) */
-/*[clinic end generated code: output=f9412bdedc69706c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7fceab7f1a85da36 input=a9049054013a1b77]*/
const char *base;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("SetBase", 0, "str", arg);
+ _PyArg_BadArgument("SetBase", "argument", "str", arg);
goto exit;
}
Py_ssize_t base_length;
}
}
else {
- _PyArg_BadArgument("ExternalEntityParserCreate", 1, "str or None", args[0]);
+ _PyArg_BadArgument("ExternalEntityParserCreate", "argument 1", "str or None", args[0]);
goto exit;
}
if (nargs < 2) {
goto skip_optional;
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("ExternalEntityParserCreate", 2, "str", args[1]);
+ _PyArg_BadArgument("ExternalEntityParserCreate", "argument 2", "str", args[1]);
goto exit;
}
Py_ssize_t encoding_length;
}
}
else {
- _PyArg_BadArgument("ParserCreate", 1, "str or None", args[0]);
+ _PyArg_BadArgument("ParserCreate", "argument 'encoding'", "str or None", args[0]);
goto exit;
}
if (!--noptargs) {
}
}
else {
- _PyArg_BadArgument("ParserCreate", 2, "str or None", args[1]);
+ _PyArg_BadArgument("ParserCreate", "argument 'namespace_separator'", "str or None", args[1]);
goto exit;
}
if (!--noptargs) {
#ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
#define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
#endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */
-/*[clinic end generated code: output=e48f37d326956bdd input=a9049054013a1b77]*/
+/*[clinic end generated code: output=133a4105d508ebec input=a9049054013a1b77]*/
goto exit;
}
if (!PyLong_Check(args[0])) {
- _PyArg_BadArgument("pthread_kill", 1, "int", args[0]);
+ _PyArg_BadArgument("pthread_kill", "argument 1", "int", args[0]);
goto exit;
}
thread_id = PyLong_AsUnsignedLongMask(args[0]);
#ifndef SIGNAL_PTHREAD_KILL_METHODDEF
#define SIGNAL_PTHREAD_KILL_METHODDEF
#endif /* !defined(SIGNAL_PTHREAD_KILL_METHODDEF) */
-/*[clinic end generated code: output=f0d3a5703581da76 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3320b8f73c20ba60 input=a9049054013a1b77]*/
PyObject *arg;
if (!PyUnicode_Check(arg_)) {
- _PyArg_BadArgument("getspnam", 0, "str", arg_);
+ _PyArg_BadArgument("getspnam", "argument", "str", arg_);
goto exit;
}
if (PyUnicode_READY(arg_) == -1) {
#ifndef SPWD_GETSPALL_METHODDEF
#define SPWD_GETSPALL_METHODDEF
#endif /* !defined(SPWD_GETSPALL_METHODDEF) */
-/*[clinic end generated code: output=2bbaa6bab1d9116e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=eec8d0bedcd312e5 input=a9049054013a1b77]*/
goto exit;
}
if (!PyUnicode_Check(args[2])) {
- _PyArg_BadArgument("symtable", 3, "str", args[2]);
+ _PyArg_BadArgument("symtable", "argument 3", "str", args[2]);
goto exit;
}
Py_ssize_t startstr_length;
exit:
return return_value;
}
-/*[clinic end generated code: output=de655625eee705f4 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a12f75cdbdf4e52a input=a9049054013a1b77]*/
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("decimal", 1, "a unicode character", args[0]);
+ _PyArg_BadArgument("decimal", "argument 1", "a unicode character", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0])) {
goto exit;
}
if (PyUnicode_GET_LENGTH(args[0]) != 1) {
- _PyArg_BadArgument("decimal", 1, "a unicode character", args[0]);
+ _PyArg_BadArgument("decimal", "argument 1", "a unicode character", args[0]);
goto exit;
}
chr = PyUnicode_READ_CHAR(args[0], 0);
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("digit", 1, "a unicode character", args[0]);
+ _PyArg_BadArgument("digit", "argument 1", "a unicode character", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0])) {
goto exit;
}
if (PyUnicode_GET_LENGTH(args[0]) != 1) {
- _PyArg_BadArgument("digit", 1, "a unicode character", args[0]);
+ _PyArg_BadArgument("digit", "argument 1", "a unicode character", args[0]);
goto exit;
}
chr = PyUnicode_READ_CHAR(args[0], 0);
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("numeric", 1, "a unicode character", args[0]);
+ _PyArg_BadArgument("numeric", "argument 1", "a unicode character", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0])) {
goto exit;
}
if (PyUnicode_GET_LENGTH(args[0]) != 1) {
- _PyArg_BadArgument("numeric", 1, "a unicode character", args[0]);
+ _PyArg_BadArgument("numeric", "argument 1", "a unicode character", args[0]);
goto exit;
}
chr = PyUnicode_READ_CHAR(args[0], 0);
int chr;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("category", 0, "a unicode character", arg);
+ _PyArg_BadArgument("category", "argument", "a unicode character", arg);
goto exit;
}
if (PyUnicode_READY(arg)) {
goto exit;
}
if (PyUnicode_GET_LENGTH(arg) != 1) {
- _PyArg_BadArgument("category", 0, "a unicode character", arg);
+ _PyArg_BadArgument("category", "argument", "a unicode character", arg);
goto exit;
}
chr = PyUnicode_READ_CHAR(arg, 0);
int chr;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("bidirectional", 0, "a unicode character", arg);
+ _PyArg_BadArgument("bidirectional", "argument", "a unicode character", arg);
goto exit;
}
if (PyUnicode_READY(arg)) {
goto exit;
}
if (PyUnicode_GET_LENGTH(arg) != 1) {
- _PyArg_BadArgument("bidirectional", 0, "a unicode character", arg);
+ _PyArg_BadArgument("bidirectional", "argument", "a unicode character", arg);
goto exit;
}
chr = PyUnicode_READ_CHAR(arg, 0);
int _return_value;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("combining", 0, "a unicode character", arg);
+ _PyArg_BadArgument("combining", "argument", "a unicode character", arg);
goto exit;
}
if (PyUnicode_READY(arg)) {
goto exit;
}
if (PyUnicode_GET_LENGTH(arg) != 1) {
- _PyArg_BadArgument("combining", 0, "a unicode character", arg);
+ _PyArg_BadArgument("combining", "argument", "a unicode character", arg);
goto exit;
}
chr = PyUnicode_READ_CHAR(arg, 0);
int _return_value;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("mirrored", 0, "a unicode character", arg);
+ _PyArg_BadArgument("mirrored", "argument", "a unicode character", arg);
goto exit;
}
if (PyUnicode_READY(arg)) {
goto exit;
}
if (PyUnicode_GET_LENGTH(arg) != 1) {
- _PyArg_BadArgument("mirrored", 0, "a unicode character", arg);
+ _PyArg_BadArgument("mirrored", "argument", "a unicode character", arg);
goto exit;
}
chr = PyUnicode_READ_CHAR(arg, 0);
int chr;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("east_asian_width", 0, "a unicode character", arg);
+ _PyArg_BadArgument("east_asian_width", "argument", "a unicode character", arg);
goto exit;
}
if (PyUnicode_READY(arg)) {
goto exit;
}
if (PyUnicode_GET_LENGTH(arg) != 1) {
- _PyArg_BadArgument("east_asian_width", 0, "a unicode character", arg);
+ _PyArg_BadArgument("east_asian_width", "argument", "a unicode character", arg);
goto exit;
}
chr = PyUnicode_READ_CHAR(arg, 0);
int chr;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("decomposition", 0, "a unicode character", arg);
+ _PyArg_BadArgument("decomposition", "argument", "a unicode character", arg);
goto exit;
}
if (PyUnicode_READY(arg)) {
goto exit;
}
if (PyUnicode_GET_LENGTH(arg) != 1) {
- _PyArg_BadArgument("decomposition", 0, "a unicode character", arg);
+ _PyArg_BadArgument("decomposition", "argument", "a unicode character", arg);
goto exit;
}
chr = PyUnicode_READ_CHAR(arg, 0);
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("is_normalized", 1, "str", args[0]);
+ _PyArg_BadArgument("is_normalized", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
form = args[0];
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("is_normalized", 2, "str", args[1]);
+ _PyArg_BadArgument("is_normalized", "argument 2", "str", args[1]);
goto exit;
}
if (PyUnicode_READY(args[1]) == -1) {
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("normalize", 1, "str", args[0]);
+ _PyArg_BadArgument("normalize", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
form = args[0];
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("normalize", 2, "str", args[1]);
+ _PyArg_BadArgument("normalize", "argument 2", "str", args[1]);
goto exit;
}
if (PyUnicode_READY(args[1]) == -1) {
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("name", 1, "a unicode character", args[0]);
+ _PyArg_BadArgument("name", "argument 1", "a unicode character", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0])) {
goto exit;
}
if (PyUnicode_GET_LENGTH(args[0]) != 1) {
- _PyArg_BadArgument("name", 1, "a unicode character", args[0]);
+ _PyArg_BadArgument("name", "argument 1", "a unicode character", args[0]);
goto exit;
}
chr = PyUnicode_READ_CHAR(args[0], 0);
exit:
return return_value;
}
-/*[clinic end generated code: output=0fc850fe5b6b312c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3238f76814fb48d1 input=a9049054013a1b77]*/
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("compress", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("compress", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("decompress", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("decompress", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&zdict, 'C')) {
- _PyArg_BadArgument("compressobj", 6, "contiguous buffer", args[5]);
+ _PyArg_BadArgument("compressobj", "argument 'zdict'", "contiguous buffer", args[5]);
goto exit;
}
skip_optional_pos:
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("compress", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("compress", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = zlib_Compress_compress_impl(self, &data);
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("decompress", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("decompress", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (!noptargs) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("adler32", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("adler32", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
goto exit;
}
if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("crc32", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("crc32", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (nargs < 2) {
#ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
#define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
#endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */
-/*[clinic end generated code: output=feb079cebbbaacd6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=faae38ef96b88b16 input=a9049054013a1b77]*/
goto exit;
}
if (!PyBuffer_IsContiguous(&frm, 'C')) {
- _PyArg_BadArgument("maketrans", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("maketrans", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyObject_GetBuffer(args[1], &to, PyBUF_SIMPLE) != 0) {
goto exit;
}
if (!PyBuffer_IsContiguous(&to, 'C')) {
- _PyArg_BadArgument("maketrans", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("maketrans", "argument 2", "contiguous buffer", args[1]);
goto exit;
}
return_value = bytearray_maketrans_impl(&frm, &to);
goto exit;
}
if (!PyBuffer_IsContiguous(&old, 'C')) {
- _PyArg_BadArgument("replace", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("replace", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyObject_GetBuffer(args[1], &new, PyBUF_SIMPLE) != 0) {
goto exit;
}
if (!PyBuffer_IsContiguous(&new, 'C')) {
- _PyArg_BadArgument("replace", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("replace", "argument 2", "contiguous buffer", args[1]);
goto exit;
}
if (nargs < 3) {
}
if (args[0]) {
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("decode", 1, "str", args[0]);
+ _PyArg_BadArgument("decode", "argument 'encoding'", "str", args[0]);
goto exit;
}
Py_ssize_t encoding_length;
}
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("decode", 2, "str", args[1]);
+ _PyArg_BadArgument("decode", "argument 'errors'", "str", args[1]);
goto exit;
}
Py_ssize_t errors_length;
PyObject *string;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("fromhex", 0, "str", arg);
+ _PyArg_BadArgument("fromhex", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
{
return bytearray_sizeof_impl(self);
}
-/*[clinic end generated code: output=7848247e5469ba1b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=09df354d3374dfb2 input=a9049054013a1b77]*/
goto exit;
}
if (!PyBuffer_IsContiguous(&sep, 'C')) {
- _PyArg_BadArgument("partition", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("partition", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = bytes_partition_impl(self, &sep);
goto exit;
}
if (!PyBuffer_IsContiguous(&sep, 'C')) {
- _PyArg_BadArgument("rpartition", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("rpartition", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = bytes_rpartition_impl(self, &sep);
goto exit;
}
if (!PyBuffer_IsContiguous(&frm, 'C')) {
- _PyArg_BadArgument("maketrans", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("maketrans", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyObject_GetBuffer(args[1], &to, PyBUF_SIMPLE) != 0) {
goto exit;
}
if (!PyBuffer_IsContiguous(&to, 'C')) {
- _PyArg_BadArgument("maketrans", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("maketrans", "argument 2", "contiguous buffer", args[1]);
goto exit;
}
return_value = bytes_maketrans_impl(&frm, &to);
goto exit;
}
if (!PyBuffer_IsContiguous(&old, 'C')) {
- _PyArg_BadArgument("replace", 1, "contiguous buffer", args[0]);
+ _PyArg_BadArgument("replace", "argument 1", "contiguous buffer", args[0]);
goto exit;
}
if (PyObject_GetBuffer(args[1], &new, PyBUF_SIMPLE) != 0) {
goto exit;
}
if (!PyBuffer_IsContiguous(&new, 'C')) {
- _PyArg_BadArgument("replace", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("replace", "argument 2", "contiguous buffer", args[1]);
goto exit;
}
if (nargs < 3) {
}
if (args[0]) {
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("decode", 1, "str", args[0]);
+ _PyArg_BadArgument("decode", "argument 'encoding'", "str", args[0]);
goto exit;
}
Py_ssize_t encoding_length;
}
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("decode", 2, "str", args[1]);
+ _PyArg_BadArgument("decode", "argument 'errors'", "str", args[1]);
goto exit;
}
Py_ssize_t errors_length;
PyObject *string;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("fromhex", 0, "str", arg);
+ _PyArg_BadArgument("fromhex", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
exit:
return return_value;
}
-/*[clinic end generated code: output=2d0a3733e13e753a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=dbed3c3ff6faa382 input=a9049054013a1b77]*/
}
if (args[7]) {
if (!PyBytes_Check(args[7])) {
- _PyArg_BadArgument("replace", 8, "bytes", args[7]);
+ _PyArg_BadArgument("replace", "argument 'co_code'", "bytes", args[7]);
goto exit;
}
co_code = (PyBytesObject *)args[7];
}
if (args[8]) {
if (!PyTuple_Check(args[8])) {
- _PyArg_BadArgument("replace", 9, "tuple", args[8]);
+ _PyArg_BadArgument("replace", "argument 'co_consts'", "tuple", args[8]);
goto exit;
}
co_consts = args[8];
}
if (args[9]) {
if (!PyTuple_Check(args[9])) {
- _PyArg_BadArgument("replace", 10, "tuple", args[9]);
+ _PyArg_BadArgument("replace", "argument 'co_names'", "tuple", args[9]);
goto exit;
}
co_names = args[9];
}
if (args[10]) {
if (!PyTuple_Check(args[10])) {
- _PyArg_BadArgument("replace", 11, "tuple", args[10]);
+ _PyArg_BadArgument("replace", "argument 'co_varnames'", "tuple", args[10]);
goto exit;
}
co_varnames = args[10];
}
if (args[11]) {
if (!PyTuple_Check(args[11])) {
- _PyArg_BadArgument("replace", 12, "tuple", args[11]);
+ _PyArg_BadArgument("replace", "argument 'co_freevars'", "tuple", args[11]);
goto exit;
}
co_freevars = args[11];
}
if (args[12]) {
if (!PyTuple_Check(args[12])) {
- _PyArg_BadArgument("replace", 13, "tuple", args[12]);
+ _PyArg_BadArgument("replace", "argument 'co_cellvars'", "tuple", args[12]);
goto exit;
}
co_cellvars = args[12];
}
if (args[13]) {
if (!PyUnicode_Check(args[13])) {
- _PyArg_BadArgument("replace", 14, "str", args[13]);
+ _PyArg_BadArgument("replace", "argument 'co_filename'", "str", args[13]);
goto exit;
}
if (PyUnicode_READY(args[13]) == -1) {
}
if (args[14]) {
if (!PyUnicode_Check(args[14])) {
- _PyArg_BadArgument("replace", 15, "str", args[14]);
+ _PyArg_BadArgument("replace", "argument 'co_name'", "str", args[14]);
goto exit;
}
if (PyUnicode_READY(args[14]) == -1) {
}
}
if (!PyBytes_Check(args[15])) {
- _PyArg_BadArgument("replace", 16, "bytes", args[15]);
+ _PyArg_BadArgument("replace", "argument 'co_lnotab'", "bytes", args[15]);
goto exit;
}
co_lnotab = (PyBytesObject *)args[15];
exit:
return return_value;
}
-/*[clinic end generated code: output=624ab6f2ea8f0ea4 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=fade581d6313a0c2 input=a9049054013a1b77]*/
const char *typestr;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("__getformat__", 0, "str", arg);
+ _PyArg_BadArgument("__getformat__", "argument", "str", arg);
goto exit;
}
Py_ssize_t typestr_length;
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("__set_format__", 1, "str", args[0]);
+ _PyArg_BadArgument("__set_format__", "argument 1", "str", args[0]);
goto exit;
}
Py_ssize_t typestr_length;
goto exit;
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("__set_format__", 2, "str", args[1]);
+ _PyArg_BadArgument("__set_format__", "argument 2", "str", args[1]);
goto exit;
}
Py_ssize_t fmt_length;
PyObject *format_spec;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("__format__", 0, "str", arg);
+ _PyArg_BadArgument("__format__", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
exit:
return return_value;
}
-/*[clinic end generated code: output=c183029d87dd41fa input=a9049054013a1b77]*/
+/*[clinic end generated code: output=cc8098eb73f1a64c input=a9049054013a1b77]*/
goto exit;
}
if (!PyObject_TypeCheck(fastargs[0], &PyCode_Type)) {
- _PyArg_BadArgument("function", 1, (&PyCode_Type)->tp_name, fastargs[0]);
+ _PyArg_BadArgument("function", "argument 'code'", (&PyCode_Type)->tp_name, fastargs[0]);
goto exit;
}
code = (PyCodeObject *)fastargs[0];
if (!PyDict_Check(fastargs[1])) {
- _PyArg_BadArgument("function", 2, "dict", fastargs[1]);
+ _PyArg_BadArgument("function", "argument 'globals'", "dict", fastargs[1]);
goto exit;
}
globals = fastargs[1];
exit:
return return_value;
}
-/*[clinic end generated code: output=1d01072cd5620d7e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3d96afa3396e5c82 input=a9049054013a1b77]*/
PyObject *format_spec;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("__format__", 0, "str", arg);
+ _PyArg_BadArgument("__format__", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
length = ival;
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("to_bytes", 2, "str", args[1]);
+ _PyArg_BadArgument("to_bytes", "argument 'byteorder'", "str", args[1]);
goto exit;
}
if (PyUnicode_READY(args[1]) == -1) {
}
bytes_obj = args[0];
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("from_bytes", 2, "str", args[1]);
+ _PyArg_BadArgument("from_bytes", "argument 'byteorder'", "str", args[1]);
goto exit;
}
if (PyUnicode_READY(args[1]) == -1) {
exit:
return return_value;
}
-/*[clinic end generated code: output=709503897c55bca1 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=77bc3b2615822cb8 input=a9049054013a1b77]*/
goto exit;
}
if (!PyUnicode_Check(fastargs[0])) {
- _PyArg_BadArgument("module", 1, "str", fastargs[0]);
+ _PyArg_BadArgument("module", "argument 'name'", "str", fastargs[0]);
goto exit;
}
if (PyUnicode_READY(fastargs[0]) == -1) {
exit:
return return_value;
}
-/*[clinic end generated code: output=d7b7ca1237597b08 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=680276bc3a496d7a input=a9049054013a1b77]*/
PyObject *format_spec;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("__format__", 0, "str", arg);
+ _PyArg_BadArgument("__format__", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
{
return object___dir___impl(self);
}
-/*[clinic end generated code: output=ea5734413064fa7e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7a6d272d282308f3 input=a9049054013a1b77]*/
}
if (args[0]) {
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("encode", 1, "str", args[0]);
+ _PyArg_BadArgument("encode", "argument 'encoding'", "str", args[0]);
goto exit;
}
Py_ssize_t encoding_length;
}
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("encode", 2, "str", args[1]);
+ _PyArg_BadArgument("encode", "argument 'errors'", "str", args[1]);
goto exit;
}
Py_ssize_t errors_length;
goto exit;
}
if (!PyUnicode_Check(args[0])) {
- _PyArg_BadArgument("replace", 1, "str", args[0]);
+ _PyArg_BadArgument("replace", "argument 1", "str", args[0]);
goto exit;
}
if (PyUnicode_READY(args[0]) == -1) {
}
old = args[0];
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("replace", 2, "str", args[1]);
+ _PyArg_BadArgument("replace", "argument 2", "str", args[1]);
goto exit;
}
if (PyUnicode_READY(args[1]) == -1) {
goto skip_optional;
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("maketrans", 2, "str", args[1]);
+ _PyArg_BadArgument("maketrans", "argument 2", "str", args[1]);
goto exit;
}
if (PyUnicode_READY(args[1]) == -1) {
goto skip_optional;
}
if (!PyUnicode_Check(args[2])) {
- _PyArg_BadArgument("maketrans", 3, "str", args[2]);
+ _PyArg_BadArgument("maketrans", "argument 3", "str", args[2]);
goto exit;
}
if (PyUnicode_READY(args[2]) == -1) {
PyObject *format_spec;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("__format__", 0, "str", arg);
+ _PyArg_BadArgument("__format__", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
{
return unicode_sizeof_impl(self);
}
-/*[clinic end generated code: output=d1541724cb4a0070 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d9a6ee45ddd0ccfd input=a9049054013a1b77]*/
fillchar = PyByteArray_AS_STRING(args[1])[0];
}
else {
- _PyArg_BadArgument("ljust", 2, "a byte string of length 1", args[1]);
+ _PyArg_BadArgument("ljust", "argument 2", "a byte string of length 1", args[1]);
goto exit;
}
skip_optional:
fillchar = PyByteArray_AS_STRING(args[1])[0];
}
else {
- _PyArg_BadArgument("rjust", 2, "a byte string of length 1", args[1]);
+ _PyArg_BadArgument("rjust", "argument 2", "a byte string of length 1", args[1]);
goto exit;
}
skip_optional:
fillchar = PyByteArray_AS_STRING(args[1])[0];
}
else {
- _PyArg_BadArgument("center", 2, "a byte string of length 1", args[1]);
+ _PyArg_BadArgument("center", "argument 2", "a byte string of length 1", args[1]);
goto exit;
}
skip_optional:
exit:
return return_value;
}
-/*[clinic end generated code: output=96cbb19b238d0e84 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=15be047aef999b4e input=a9049054013a1b77]*/
}
file = args[0];
if (!PyBytes_Check(args[1])) {
- _PyArg_BadArgument("write_input", 2, "bytes", args[1]);
+ _PyArg_BadArgument("write_input", "argument 's'", "bytes", args[1]);
goto exit;
}
s = (PyBytesObject *)args[1];
#ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF
#define _TESTCONSOLE_READ_OUTPUT_METHODDEF
#endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */
-/*[clinic end generated code: output=ef452d5fb9287fc2 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=dd8b093a91b62753 input=a9049054013a1b77]*/
char_value = PyByteArray_AS_STRING(arg)[0];
}
else {
- _PyArg_BadArgument("putch", 0, "a byte string of length 1", arg);
+ _PyArg_BadArgument("putch", "argument", "a byte string of length 1", arg);
goto exit;
}
return_value = msvcrt_putch_impl(module, char_value);
int unicode_char;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("putwch", 0, "a unicode character", arg);
+ _PyArg_BadArgument("putwch", "argument", "a unicode character", arg);
goto exit;
}
if (PyUnicode_READY(arg)) {
goto exit;
}
if (PyUnicode_GET_LENGTH(arg) != 1) {
- _PyArg_BadArgument("putwch", 0, "a unicode character", arg);
+ _PyArg_BadArgument("putwch", "argument", "a unicode character", arg);
goto exit;
}
unicode_char = PyUnicode_READ_CHAR(arg, 0);
char_value = PyByteArray_AS_STRING(arg)[0];
}
else {
- _PyArg_BadArgument("ungetch", 0, "a byte string of length 1", arg);
+ _PyArg_BadArgument("ungetch", "argument", "a byte string of length 1", arg);
goto exit;
}
return_value = msvcrt_ungetch_impl(module, char_value);
int unicode_char;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("ungetwch", 0, "a unicode character", arg);
+ _PyArg_BadArgument("ungetwch", "argument", "a unicode character", arg);
goto exit;
}
if (PyUnicode_READY(arg)) {
goto exit;
}
if (PyUnicode_GET_LENGTH(arg) != 1) {
- _PyArg_BadArgument("ungetwch", 0, "a unicode character", arg);
+ _PyArg_BadArgument("ungetwch", "argument", "a unicode character", arg);
goto exit;
}
unicode_char = PyUnicode_READ_CHAR(arg, 0);
#ifndef MSVCRT_SET_ERROR_MODE_METHODDEF
#define MSVCRT_SET_ERROR_MODE_METHODDEF
#endif /* !defined(MSVCRT_SET_ERROR_MODE_METHODDEF) */
-/*[clinic end generated code: output=816bc4f993893cea input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7cc6ffaf64f268f7 input=a9049054013a1b77]*/
goto skip_optional;
}
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("format", 2, "str", args[1]);
+ _PyArg_BadArgument("format", "argument 2", "str", args[1]);
goto exit;
}
if (PyUnicode_READY(args[1]) == -1) {
goto exit;
}
if (!PyUnicode_Check(args[2])) {
- _PyArg_BadArgument("compile", 3, "str", args[2]);
+ _PyArg_BadArgument("compile", "argument 'mode'", "str", args[2]);
goto exit;
}
Py_ssize_t mode_length;
exit:
return return_value;
}
-/*[clinic end generated code: output=e173df340a9e4516 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1927f3c9abd00c35 input=a9049054013a1b77]*/
goto exit;
}
if (!PyObject_TypeCheck(args[0], &PyCode_Type)) {
- _PyArg_BadArgument("_fix_co_filename", 1, (&PyCode_Type)->tp_name, args[0]);
+ _PyArg_BadArgument("_fix_co_filename", "argument 1", (&PyCode_Type)->tp_name, args[0]);
goto exit;
}
code = (PyCodeObject *)args[0];
if (!PyUnicode_Check(args[1])) {
- _PyArg_BadArgument("_fix_co_filename", 2, "str", args[1]);
+ _PyArg_BadArgument("_fix_co_filename", "argument 2", "str", args[1]);
goto exit;
}
if (PyUnicode_READY(args[1]) == -1) {
PyObject *name;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("init_frozen", 0, "str", arg);
+ _PyArg_BadArgument("init_frozen", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
PyObject *name;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("get_frozen_object", 0, "str", arg);
+ _PyArg_BadArgument("get_frozen_object", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
PyObject *name;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("is_frozen_package", 0, "str", arg);
+ _PyArg_BadArgument("is_frozen_package", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
PyObject *name;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("is_builtin", 0, "str", arg);
+ _PyArg_BadArgument("is_builtin", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
PyObject *name;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("is_frozen", 0, "str", arg);
+ _PyArg_BadArgument("is_frozen", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
goto exit;
}
if (!PyBuffer_IsContiguous(&source, 'C')) {
- _PyArg_BadArgument("source_hash", 2, "contiguous buffer", args[1]);
+ _PyArg_BadArgument("source_hash", "argument 'source'", "contiguous buffer", args[1]);
goto exit;
}
return_value = _imp_source_hash_impl(module, key, &source);
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
#define _IMP_EXEC_DYNAMIC_METHODDEF
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
-/*[clinic end generated code: output=b51244770fdcf4b8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ff06f7cf4b73eb76 input=a9049054013a1b77]*/
goto exit;
}
if (!PyBuffer_IsContiguous(&bytes, 'C')) {
- _PyArg_BadArgument("loads", 0, "contiguous buffer", arg);
+ _PyArg_BadArgument("loads", "argument", "contiguous buffer", arg);
goto exit;
}
return_value = marshal_loads_impl(module, &bytes);
return return_value;
}
-/*[clinic end generated code: output=ae2bca1aa239e095 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a859dabe8b0afeb6 input=a9049054013a1b77]*/
PyObject *s;
if (!PyUnicode_Check(arg)) {
- _PyArg_BadArgument("intern", 0, "str", arg);
+ _PyArg_BadArgument("intern", "argument", "str", arg);
goto exit;
}
if (PyUnicode_READY(arg) == -1) {
}
func = args[0];
if (!PyTuple_Check(args[1])) {
- _PyArg_BadArgument("call_tracing", 2, "tuple", args[1]);
+ _PyArg_BadArgument("call_tracing", "argument 2", "tuple", args[1]);
goto exit;
}
funcargs = args[1];
#ifndef SYS_GETANDROIDAPILEVEL_METHODDEF
#define SYS_GETANDROIDAPILEVEL_METHODDEF
#endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */
-/*[clinic end generated code: output=1a67b37c4486d65f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=092edc868de055a6 input=a9049054013a1b77]*/
}
tb_next = fastargs[0];
if (!PyObject_TypeCheck(fastargs[1], &PyFrame_Type)) {
- _PyArg_BadArgument("TracebackType", 2, (&PyFrame_Type)->tp_name, fastargs[1]);
+ _PyArg_BadArgument("TracebackType", "argument 'tb_frame'", (&PyFrame_Type)->tp_name, fastargs[1]);
goto exit;
}
tb_frame = (PyFrameObject *)fastargs[1];
exit:
return return_value;
}
-/*[clinic end generated code: output=7e4c0e252d0973b0 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3def6c06248feed8 input=a9049054013a1b77]*/
-/* Format an error message generated by convertsimple(). */
+/* Format an error message generated by convertsimple().
+ displayname must be UTF-8 encoded.
+*/
void
-_PyArg_BadArgument(const char *fname, int iarg,
+_PyArg_BadArgument(const char *fname, const char *displayname,
const char *expected, PyObject *arg)
{
- if (iarg) {
- PyErr_Format(PyExc_TypeError,
- "%.200s() argument %d must be %.50s, not %.50s",
- fname, iarg, expected,
- arg == Py_None ? "None" : arg->ob_type->tp_name);
- }
- else {
- PyErr_Format(PyExc_TypeError,
- "%.200s() argument must be %.50s, not %.50s",
- fname, expected,
- arg == Py_None ? "None" : arg->ob_type->tp_name);
- }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() %.200s must be %.50s, not %.50s",
+ fname, displayname, expected,
+ arg == Py_None ? "None" : arg->ob_type->tp_name);
}
static const char *
{c_basename}({self_type}{self_name}, PyObject *%s)
""" % argname)
- parsearg = converters[0].parse_arg(argname, 0)
+ displayname = parameters[0].get_displayname(0)
+ parsearg = converters[0].parse_arg(argname, displayname)
if parsearg is None:
parsearg = """
if (!PyArg_Parse(%s, "{format_units}:{name}", {parse_arguments})) {{
""" % (nargs, min_pos, max_pos), indent=4)]
has_optional = False
for i, p in enumerate(parameters):
- parsearg = p.converter.parse_arg(argname_fmt % i, i + 1)
+ displayname = p.get_displayname(i+1)
+ parsearg = p.converter.parse_arg(argname_fmt % i, displayname)
if parsearg is None:
#print('Cannot convert %s %r for %s' % (p.converter.__class__.__name__, p.converter.format_unit, p.converter.name), file=sys.stderr)
parser_code = None
add_label = None
for i, p in enumerate(parameters):
- parsearg = p.converter.parse_arg(argname_fmt % i, i + 1)
+ displayname = p.get_displayname(i+1)
+ parsearg = p.converter.parse_arg(argname_fmt % i, displayname)
if parsearg is None:
#print('Cannot convert %s %r for %s' % (p.converter.__class__.__name__, p.converter.format_unit, p.converter.name), file=sys.stderr)
parser_code = None
kwargs['converter'] = converter
return Parameter(**kwargs)
+ def get_displayname(self, i):
+ if i == 0:
+ return '"argument"'
+ if not self.is_positional_only():
+ return '''"argument '{}'"'''.format(self.name)
+ else:
+ return '"argument {}"'.format(i)
class LandMine:
"""
pass
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'O&':
return """
if (!{converter}({argname}, &{paramname})) {{{{
typecheck, typename = type_checks[self.subclass_of]
return """
if (!{typecheck}({argname})) {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "{typename}", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "{typename}", {argname});
goto exit;
}}}}
{paramname} = {cast}{argname};
""".format(argname=argname, paramname=self.name,
- argnum=argnum,
- typecheck=typecheck, typename=typename, cast=cast)
+ displayname=displayname, typecheck=typecheck,
+ typename=typename, cast=cast)
return """
if (!PyObject_TypeCheck({argname}, {subclass_of})) {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, ({subclass_of})->tp_name, {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, ({subclass_of})->tp_name, {argname});
goto exit;
}}}}
{paramname} = {cast}{argname};
- """.format(argname=argname, paramname=self.name, argnum=argnum,
- subclass_of=self.subclass_of, cast=cast)
+ """.format(argname=argname, paramname=self.name,
+ subclass_of=self.subclass_of, cast=cast,
+ displayname=displayname)
if self.format_unit == 'O':
cast = '(%s)' % self.type if self.type != 'PyObject *' else ''
return """
self.default = bool(self.default)
self.c_default = str(int(self.default))
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'i':
# XXX PyFloat_Check can be removed after the end of the
# deprecation in _PyLong_FromNbIndexOrNbInt.
goto exit;
}}}}
""".format(argname=argname, paramname=self.name)
- return super().parse_arg(argname, argnum)
+ return super().parse_arg(argname, displayname)
class char_converter(CConverter):
type = 'char'
if self.c_default == '"\'"':
self.c_default = r"'\''"
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'c':
return """
if (PyBytes_Check({argname}) && PyBytes_GET_SIZE({argname}) == 1) {{{{
{paramname} = PyByteArray_AS_STRING({argname})[0];
}}}}
else {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "a byte string of length 1", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "a byte string of length 1", {argname});
goto exit;
}}}}
- """.format(argname=argname, paramname=self.name, argnum=argnum)
- return super().parse_arg(argname, argnum)
+ """.format(argname=argname, paramname=self.name,
+ displayname=displayname)
+ return super().parse_arg(argname, displayname)
@add_legacy_c_converter('B', bitwise=True)
if bitwise:
self.format_unit = 'B'
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'b':
return """
if (PyFloat_Check({argname})) {{{{
}}}}
}}}}
""".format(argname=argname, paramname=self.name)
- return super().parse_arg(argname, argnum)
+ return super().parse_arg(argname, displayname)
class byte_converter(unsigned_char_converter): pass
format_unit = 'h'
c_ignored_default = "0"
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'h':
return """
if (PyFloat_Check({argname})) {{{{
}}}}
}}}}
""".format(argname=argname, paramname=self.name)
- return super().parse_arg(argname, argnum)
+ return super().parse_arg(argname, displayname)
class unsigned_short_converter(CConverter):
type = 'unsigned short'
else:
self.converter = '_PyLong_UnsignedShort_Converter'
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'H':
return """
if (PyFloat_Check({argname})) {{{{
goto exit;
}}}}
""".format(argname=argname, paramname=self.name)
- return super().parse_arg(argname, argnum)
+ return super().parse_arg(argname, displayname)
@add_legacy_c_converter('C', accept={str})
class int_converter(CConverter):
if type != None:
self.type = type
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'i':
return """
if (PyFloat_Check({argname})) {{{{
elif self.format_unit == 'C':
return """
if (!PyUnicode_Check({argname})) {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "a unicode character", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "a unicode character", {argname});
goto exit;
}}}}
if (PyUnicode_READY({argname})) {{{{
goto exit;
}}}}
if (PyUnicode_GET_LENGTH({argname}) != 1) {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "a unicode character", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "a unicode character", {argname});
goto exit;
}}}}
{paramname} = PyUnicode_READ_CHAR({argname}, 0);
- """.format(argname=argname, paramname=self.name, argnum=argnum)
- return super().parse_arg(argname, argnum)
+ """.format(argname=argname, paramname=self.name,
+ displayname=displayname)
+ return super().parse_arg(argname, displayname)
class unsigned_int_converter(CConverter):
type = 'unsigned int'
else:
self.converter = '_PyLong_UnsignedInt_Converter'
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'I':
return """
if (PyFloat_Check({argname})) {{{{
goto exit;
}}}}
""".format(argname=argname, paramname=self.name)
- return super().parse_arg(argname, argnum)
+ return super().parse_arg(argname, displayname)
class long_converter(CConverter):
type = 'long'
format_unit = 'l'
c_ignored_default = "0"
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'l':
return """
if (PyFloat_Check({argname})) {{{{
goto exit;
}}}}
""".format(argname=argname, paramname=self.name)
- return super().parse_arg(argname, argnum)
+ return super().parse_arg(argname, displayname)
class unsigned_long_converter(CConverter):
type = 'unsigned long'
else:
self.converter = '_PyLong_UnsignedLong_Converter'
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'k':
return """
if (!PyLong_Check({argname})) {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "int", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "int", {argname});
goto exit;
}}}}
{paramname} = PyLong_AsUnsignedLongMask({argname});
- """.format(argname=argname, paramname=self.name, argnum=argnum)
- return super().parse_arg(argname, argnum)
+ """.format(argname=argname, paramname=self.name,
+ displayname=displayname)
+ return super().parse_arg(argname, displayname)
class long_long_converter(CConverter):
type = 'long long'
format_unit = 'L'
c_ignored_default = "0"
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'L':
return """
if (PyFloat_Check({argname})) {{{{
goto exit;
}}}}
""".format(argname=argname, paramname=self.name)
- return super().parse_arg(argname, argnum)
+ return super().parse_arg(argname, displayname)
class unsigned_long_long_converter(CConverter):
type = 'unsigned long long'
else:
self.converter = '_PyLong_UnsignedLongLong_Converter'
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'K':
return """
if (!PyLong_Check({argname})) {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "int", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "int", {argname});
goto exit;
}}}}
{paramname} = PyLong_AsUnsignedLongLongMask({argname});
- """.format(argname=argname, paramname=self.name, argnum=argnum)
- return super().parse_arg(argname, argnum)
+ """.format(argname=argname, paramname=self.name,
+ displayname=displayname)
+ return super().parse_arg(argname, displayname)
class Py_ssize_t_converter(CConverter):
type = 'Py_ssize_t'
else:
fail("Py_ssize_t_converter: illegal 'accept' argument " + repr(accept))
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'n':
return """
if (PyFloat_Check({argname})) {{{{
{paramname} = ival;
}}}}
""".format(argname=argname, paramname=self.name)
- return super().parse_arg(argname, argnum)
+ return super().parse_arg(argname, displayname)
class slice_index_converter(CConverter):
converter = '_PyLong_Size_t_Converter'
c_ignored_default = "0"
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'n':
return """
{paramname} = PyNumber_AsSsize_t({argname}, PyExc_OverflowError);
goto exit;
}}}}
""".format(argname=argname, paramname=self.name)
- return super().parse_arg(argname, argnum)
+ return super().parse_arg(argname, displayname)
class float_converter(CConverter):
format_unit = 'f'
c_ignored_default = "0.0"
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'f':
return """
if (PyFloat_CheckExact({argname})) {{{{
}}}}
}}}}
""".format(argname=argname, paramname=self.name)
- return super().parse_arg(argname, argnum)
+ return super().parse_arg(argname, displayname)
class double_converter(CConverter):
type = 'double'
format_unit = 'd'
c_ignored_default = "0.0"
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'd':
return """
if (PyFloat_CheckExact({argname})) {{{{
}}}}
}}}}
""".format(argname=argname, paramname=self.name)
- return super().parse_arg(argname, argnum)
+ return super().parse_arg(argname, displayname)
class Py_complex_converter(CConverter):
format_unit = 'D'
c_ignored_default = "{0.0, 0.0}"
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'D':
return """
{paramname} = PyComplex_AsCComplex({argname});
goto exit;
}}}}
""".format(argname=argname, paramname=self.name)
- return super().parse_arg(argname, argnum)
+ return super().parse_arg(argname, displayname)
class object_converter(CConverter):
name = self.name
return "".join(["if (", name, ") {\n PyMem_FREE(", name, ");\n}\n"])
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 's':
return """
if (!PyUnicode_Check({argname})) {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "str", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "str", {argname});
goto exit;
}}}}
Py_ssize_t {paramname}_length;
PyErr_SetString(PyExc_ValueError, "embedded null character");
goto exit;
}}}}
- """.format(argname=argname, paramname=self.name, argnum=argnum)
+ """.format(argname=argname, paramname=self.name,
+ displayname=displayname)
if self.format_unit == 'z':
return """
if ({argname} == Py_None) {{{{
}}}}
}}}}
else {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "str or None", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "str or None", {argname});
goto exit;
}}}}
- """.format(argname=argname, paramname=self.name, argnum=argnum)
- return super().parse_arg(argname, argnum)
+ """.format(argname=argname, paramname=self.name,
+ displayname=displayname)
+ return super().parse_arg(argname, displayname)
#
# This is the fourth or fifth rewrite of registering all the
format_unit = 'S'
# accept = {bytes}
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'S':
return """
if (!PyBytes_Check({argname})) {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "bytes", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "bytes", {argname});
goto exit;
}}}}
{paramname} = ({type}){argname};
- """.format(argname=argname, paramname=self.name, argnum=argnum,
- type=self.type)
- return super().parse_arg(argname, argnum)
+ """.format(argname=argname, paramname=self.name,
+ type=self.type, displayname=displayname)
+ return super().parse_arg(argname, displayname)
class PyByteArrayObject_converter(CConverter):
type = 'PyByteArrayObject *'
format_unit = 'Y'
# accept = {bytearray}
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'Y':
return """
if (!PyByteArray_Check({argname})) {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "bytearray", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "bytearray", {argname});
goto exit;
}}}}
{paramname} = ({type}){argname};
- """.format(argname=argname, paramname=self.name, argnum=argnum,
- type=self.type)
- return super().parse_arg(argname, argnum)
+ """.format(argname=argname, paramname=self.name,
+ type=self.type, displayname=displayname)
+ return super().parse_arg(argname, displayname)
class unicode_converter(CConverter):
type = 'PyObject *'
default_type = (str, Null, NoneType)
format_unit = 'U'
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'U':
return """
if (!PyUnicode_Check({argname})) {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "str", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "str", {argname});
goto exit;
}}}}
if (PyUnicode_READY({argname}) == -1) {{{{
goto exit;
}}}}
{paramname} = {argname};
- """.format(argname=argname, paramname=self.name, argnum=argnum)
- return super().parse_arg(argname, argnum)
+ """.format(argname=argname, paramname=self.name,
+ displayname=displayname)
+ return super().parse_arg(argname, displayname)
@add_legacy_c_converter('u#', zeroes=True)
@add_legacy_c_converter('Z', accept={str, NoneType})
name = self.name
return "".join(["if (", name, ".obj) {\n PyBuffer_Release(&", name, ");\n}\n"])
- def parse_arg(self, argname, argnum):
+ def parse_arg(self, argname, displayname):
if self.format_unit == 'y*':
return """
if (PyObject_GetBuffer({argname}, &{paramname}, PyBUF_SIMPLE) != 0) {{{{
goto exit;
}}}}
if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "contiguous buffer", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "contiguous buffer", {argname});
goto exit;
}}}}
- """.format(argname=argname, paramname=self.name, argnum=argnum)
+ """.format(argname=argname, paramname=self.name,
+ displayname=displayname)
elif self.format_unit == 's*':
return """
if (PyUnicode_Check({argname})) {{{{
goto exit;
}}}}
if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "contiguous buffer", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "contiguous buffer", {argname});
goto exit;
}}}}
}}}}
- """.format(argname=argname, paramname=self.name, argnum=argnum)
+ """.format(argname=argname, paramname=self.name,
+ displayname=displayname)
elif self.format_unit == 'w*':
return """
if (PyObject_GetBuffer({argname}, &{paramname}, PyBUF_WRITABLE) < 0) {{{{
PyErr_Clear();
- _PyArg_BadArgument("{{name}}", {argnum}, "read-write bytes-like object", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "read-write bytes-like object", {argname});
goto exit;
}}}}
if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{
- _PyArg_BadArgument("{{name}}", {argnum}, "contiguous buffer", {argname});
+ _PyArg_BadArgument("{{name}}", {displayname}, "contiguous buffer", {argname});
goto exit;
}}}}
- """.format(argname=argname, paramname=self.name, argnum=argnum)
- return super().parse_arg(argname, argnum)
+ """.format(argname=argname, paramname=self.name,
+ displayname=displayname)
+ return super().parse_arg(argname, displayname)
def correct_name_for_self(f):