mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593)
This commit is contained in:
committed by
Serhiy Storchaka
parent
59725f3bad
commit
4901fe274b
@@ -66,7 +66,7 @@ PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args);
|
||||
#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) \
|
||||
|
||||
@@ -44,7 +44,7 @@ test_object_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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];
|
||||
@@ -58,7 +58,7 @@ exit:
|
||||
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]
|
||||
@@ -180,52 +180,52 @@ test_object_converter_subclass_of(PyObject *module, PyObject *const *args, Py_ss
|
||||
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];
|
||||
@@ -240,7 +240,7 @@ test_object_converter_subclass_of_impl(PyObject *module, PyObject *a,
|
||||
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]
|
||||
@@ -269,7 +269,7 @@ test_PyBytesObject_converter(PyObject *module, PyObject *arg)
|
||||
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;
|
||||
@@ -281,7 +281,7 @@ exit:
|
||||
|
||||
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]
|
||||
@@ -310,7 +310,7 @@ test_PyByteArrayObject_converter(PyObject *module, PyObject *arg)
|
||||
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;
|
||||
@@ -322,7 +322,7 @@ exit:
|
||||
|
||||
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]
|
||||
@@ -351,7 +351,7 @@ test_unicode_converter(PyObject *module, PyObject *arg)
|
||||
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) {
|
||||
@@ -366,7 +366,7 @@ exit:
|
||||
|
||||
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]
|
||||
@@ -507,7 +507,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -520,7 +520,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -533,7 +533,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -546,7 +546,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -559,7 +559,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -572,7 +572,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -585,7 +585,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -598,7 +598,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -611,7 +611,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -624,7 +624,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -637,7 +637,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -650,7 +650,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -663,7 +663,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -676,7 +676,7 @@ test_char_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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:
|
||||
@@ -690,7 +690,7 @@ static PyObject *
|
||||
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]
|
||||
@@ -1009,14 +1009,14 @@ test_int_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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);
|
||||
@@ -1041,7 +1041,7 @@ exit:
|
||||
|
||||
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]
|
||||
@@ -1215,7 +1215,7 @@ test_unsigned_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t
|
||||
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]);
|
||||
@@ -1229,7 +1229,7 @@ exit:
|
||||
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]
|
||||
@@ -1335,7 +1335,7 @@ test_unsigned_long_long_converter(PyObject *module, PyObject *const *args, Py_ss
|
||||
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]);
|
||||
@@ -1351,7 +1351,7 @@ test_unsigned_long_long_converter_impl(PyObject *module,
|
||||
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]
|
||||
@@ -3207,3 +3207,56 @@ test_posonly_opt_keywords_opt_kwonly_opt_impl(PyObject *module, PyObject *a,
|
||||
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]*/
|
||||
|
||||
@@ -286,7 +286,7 @@ class NamespaceSeparatorTest(unittest.TestCase):
|
||||
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')
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
Argument Clinic now uses the argument name on errors with keyword-only
|
||||
argument instead of their position. Patch contributed by Rémi Lapeyre.
|
||||
@@ -72,7 +72,7 @@ skip_optional_posonly:
|
||||
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) {
|
||||
@@ -84,7 +84,7 @@ skip_optional_posonly:
|
||||
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) {
|
||||
@@ -96,7 +96,7 @@ skip_optional_posonly:
|
||||
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) {
|
||||
@@ -261,4 +261,4 @@ _blake2_blake2b_hexdigest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _blake2_blake2b_hexdigest_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=a91d182ce1109f34 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=cbb625d7f60c288c input=a9049054013a1b77]*/
|
||||
|
||||
@@ -72,7 +72,7 @@ skip_optional_posonly:
|
||||
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) {
|
||||
@@ -84,7 +84,7 @@ skip_optional_posonly:
|
||||
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) {
|
||||
@@ -96,7 +96,7 @@ skip_optional_posonly:
|
||||
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) {
|
||||
@@ -261,4 +261,4 @@ _blake2_blake2s_hexdigest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _blake2_blake2s_hexdigest_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=ae8e9b7301d092b4 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=39af5a74c8805b36 input=a9049054013a1b77]*/
|
||||
|
||||
@@ -161,7 +161,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw
|
||||
}
|
||||
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;
|
||||
@@ -207,7 +207,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw
|
||||
}
|
||||
}
|
||||
else {
|
||||
_PyArg_BadArgument("open", 4, "str or None", args[3]);
|
||||
_PyArg_BadArgument("open", "argument 'encoding'", "str or None", args[3]);
|
||||
goto exit;
|
||||
}
|
||||
if (!--noptargs) {
|
||||
@@ -230,7 +230,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw
|
||||
}
|
||||
}
|
||||
else {
|
||||
_PyArg_BadArgument("open", 5, "str or None", args[4]);
|
||||
_PyArg_BadArgument("open", "argument 'errors'", "str or None", args[4]);
|
||||
goto exit;
|
||||
}
|
||||
if (!--noptargs) {
|
||||
@@ -253,7 +253,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw
|
||||
}
|
||||
}
|
||||
else {
|
||||
_PyArg_BadArgument("open", 6, "str or None", args[5]);
|
||||
_PyArg_BadArgument("open", "argument 'newline'", "str or None", args[5]);
|
||||
goto exit;
|
||||
}
|
||||
if (!--noptargs) {
|
||||
@@ -311,7 +311,7 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec
|
||||
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) {
|
||||
@@ -323,4 +323,4 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=d479285078750d68 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=3df6bc6d91697545 input=a9049054013a1b77]*/
|
||||
|
||||
@@ -21,11 +21,11 @@ _io__BufferedIOBase_readinto(PyObject *self, PyObject *arg)
|
||||
|
||||
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);
|
||||
@@ -58,11 +58,11 @@ _io__BufferedIOBase_readinto1(PyObject *self, PyObject *arg)
|
||||
|
||||
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);
|
||||
@@ -243,11 +243,11 @@ _io__Buffered_readinto(buffered *self, PyObject *arg)
|
||||
|
||||
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);
|
||||
@@ -280,11 +280,11 @@ _io__Buffered_readinto1(buffered *self, PyObject *arg)
|
||||
|
||||
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);
|
||||
@@ -538,7 +538,7 @@ _io_BufferedWriter_write(buffered *self, PyObject *arg)
|
||||
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);
|
||||
@@ -672,4 +672,4 @@ skip_optional_pos:
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=b22b4aedd53c340a input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=7246104f6c7d3167 input=a9049054013a1b77]*/
|
||||
|
||||
@@ -319,11 +319,11 @@ _io_BytesIO_readinto(bytesio *self, PyObject *arg)
|
||||
|
||||
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);
|
||||
@@ -515,4 +515,4 @@ skip_optional_pos:
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=22e8fb54874b6ee5 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=4ec2506def9c8eb9 input=a9049054013a1b77]*/
|
||||
|
||||
@@ -70,7 +70,7 @@ _io_FileIO___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
}
|
||||
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;
|
||||
@@ -200,11 +200,11 @@ _io_FileIO_readinto(fileio *self, PyObject *arg)
|
||||
|
||||
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);
|
||||
@@ -303,7 +303,7 @@ _io_FileIO_write(fileio *self, PyObject *arg)
|
||||
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);
|
||||
@@ -447,4 +447,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored))
|
||||
#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]*/
|
||||
|
||||
@@ -229,7 +229,7 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
}
|
||||
}
|
||||
else {
|
||||
_PyArg_BadArgument("TextIOWrapper", 2, "str or None", fastargs[1]);
|
||||
_PyArg_BadArgument("TextIOWrapper", "argument 'encoding'", "str or None", fastargs[1]);
|
||||
goto exit;
|
||||
}
|
||||
if (!--noptargs) {
|
||||
@@ -258,7 +258,7 @@ _io_TextIOWrapper___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
}
|
||||
}
|
||||
else {
|
||||
_PyArg_BadArgument("TextIOWrapper", 4, "str or None", fastargs[3]);
|
||||
_PyArg_BadArgument("TextIOWrapper", "argument 'newline'", "str or None", fastargs[3]);
|
||||
goto exit;
|
||||
}
|
||||
if (!--noptargs) {
|
||||
@@ -401,7 +401,7 @@ _io_TextIOWrapper_write(textio *self, PyObject *arg)
|
||||
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) {
|
||||
@@ -701,4 +701,4 @@ _io_TextIOWrapper_close(textio *self, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _io_TextIOWrapper_close_impl(self);
|
||||
}
|
||||
/*[clinic end generated code: output=b651e056e3000f88 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=b1bae4f4cdf6019e input=a9049054013a1b77]*/
|
||||
|
||||
@@ -69,7 +69,7 @@ _io__WindowsConsoleIO___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
}
|
||||
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;
|
||||
@@ -200,11 +200,11 @@ _io__WindowsConsoleIO_readinto(winconsoleio *self, PyObject *arg)
|
||||
|
||||
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);
|
||||
@@ -313,7 +313,7 @@ _io__WindowsConsoleIO_write(winconsoleio *self, PyObject *arg)
|
||||
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);
|
||||
@@ -386,4 +386,4 @@ _io__WindowsConsoleIO_isatty(winconsoleio *self, PyObject *Py_UNUSED(ignored))
|
||||
#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]*/
|
||||
|
||||
@@ -35,7 +35,7 @@ _posixshmem_shm_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs,
|
||||
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) {
|
||||
@@ -108,7 +108,7 @@ _posixshmem_shm_unlink(PyObject *module, PyObject *const *args, Py_ssize_t nargs
|
||||
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) {
|
||||
@@ -130,4 +130,4 @@ exit:
|
||||
#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]*/
|
||||
|
||||
@@ -55,7 +55,7 @@ _multibytecodec_MultibyteCodec_encode(MultibyteCodecObject *self, PyObject *cons
|
||||
}
|
||||
}
|
||||
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:
|
||||
@@ -103,7 +103,7 @@ _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *cons
|
||||
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) {
|
||||
@@ -124,7 +124,7 @@ _multibytecodec_MultibyteCodec_decode(MultibyteCodecObject *self, PyObject *cons
|
||||
}
|
||||
}
|
||||
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:
|
||||
@@ -223,7 +223,7 @@ _multibytecodec_MultibyteIncrementalEncoder_setstate(MultibyteIncrementalEncoder
|
||||
PyLongObject *statelong;
|
||||
|
||||
if (!PyLong_Check(arg)) {
|
||||
_PyArg_BadArgument("setstate", 0, "int", arg);
|
||||
_PyArg_BadArgument("setstate", "argument", "int", arg);
|
||||
goto exit;
|
||||
}
|
||||
statelong = (PyLongObject *)arg;
|
||||
@@ -282,7 +282,7 @@ _multibytecodec_MultibyteIncrementalDecoder_decode(MultibyteIncrementalDecoderOb
|
||||
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) {
|
||||
@@ -345,7 +345,7 @@ _multibytecodec_MultibyteIncrementalDecoder_setstate(MultibyteIncrementalDecoder
|
||||
PyObject *state;
|
||||
|
||||
if (!PyTuple_Check(arg)) {
|
||||
_PyArg_BadArgument("setstate", 0, "tuple", arg);
|
||||
_PyArg_BadArgument("setstate", "argument", "tuple", arg);
|
||||
goto exit;
|
||||
}
|
||||
state = arg;
|
||||
@@ -525,4 +525,4 @@ PyDoc_STRVAR(_multibytecodec___create_codec__doc__,
|
||||
|
||||
#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]*/
|
||||
|
||||
6
Modules/clinic/_bz2module.c.h
generated
6
Modules/clinic/_bz2module.c.h
generated
@@ -29,7 +29,7 @@ _bz2_BZ2Compressor_compress(BZ2Compressor *self, PyObject *arg)
|
||||
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);
|
||||
@@ -156,7 +156,7 @@ _bz2_BZ2Decompressor_decompress(BZ2Decompressor *self, PyObject *const *args, Py
|
||||
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) {
|
||||
@@ -220,4 +220,4 @@ _bz2_BZ2Decompressor___init__(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=8e123f4eec497655 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=ec3d1b3652c98823 input=a9049054013a1b77]*/
|
||||
|
||||
168
Modules/clinic/_codecsmodule.c.h
generated
168
Modules/clinic/_codecsmodule.c.h
generated
File diff suppressed because it is too large
Load Diff
6
Modules/clinic/_cryptmodule.c.h
generated
6
Modules/clinic/_cryptmodule.c.h
generated
@@ -30,7 +30,7 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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;
|
||||
@@ -43,7 +43,7 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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;
|
||||
@@ -60,4 +60,4 @@ crypt_crypt(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=3f75d4d4be4dddbb input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=549de0d43b030126 input=a9049054013a1b77]*/
|
||||
|
||||
6
Modules/clinic/_curses_panel.c.h
generated
6
Modules/clinic/_curses_panel.c.h
generated
@@ -214,7 +214,7 @@ _curses_panel_panel_replace(PyCursesPanelObject *self, PyObject *arg)
|
||||
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;
|
||||
@@ -288,7 +288,7 @@ _curses_panel_new_panel(PyObject *module, PyObject *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;
|
||||
@@ -335,4 +335,4 @@ _curses_panel_update_panels(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
return _curses_panel_update_panels_impl(module);
|
||||
}
|
||||
/*[clinic end generated code: output=3cc16062281b7e07 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=d96dc1fd68e898d9 input=a9049054013a1b77]*/
|
||||
|
||||
14
Modules/clinic/_cursesmodule.c.h
generated
14
Modules/clinic/_cursesmodule.c.h
generated
@@ -2521,7 +2521,7 @@ _curses_ungetmouse(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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]);
|
||||
@@ -3017,7 +3017,7 @@ _curses_setupterm(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyO
|
||||
}
|
||||
}
|
||||
else {
|
||||
_PyArg_BadArgument("setupterm", 1, "str or None", args[0]);
|
||||
_PyArg_BadArgument("setupterm", "argument 'term'", "str or None", args[0]);
|
||||
goto exit;
|
||||
}
|
||||
if (!--noptargs) {
|
||||
@@ -3326,7 +3326,7 @@ _curses_mousemask(PyObject *module, PyObject *arg)
|
||||
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);
|
||||
@@ -4201,7 +4201,7 @@ _curses_tigetflag(PyObject *module, PyObject *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;
|
||||
@@ -4244,7 +4244,7 @@ _curses_tigetnum(PyObject *module, PyObject *arg)
|
||||
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;
|
||||
@@ -4287,7 +4287,7 @@ _curses_tigetstr(PyObject *module, PyObject *arg)
|
||||
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;
|
||||
@@ -4569,4 +4569,4 @@ _curses_use_default_colors(PyObject *module, PyObject *Py_UNUSED(ignored))
|
||||
#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]*/
|
||||
|
||||
6
Modules/clinic/_dbmmodule.c.h
generated
6
Modules/clinic/_dbmmodule.c.h
generated
@@ -136,7 +136,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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) {
|
||||
@@ -147,7 +147,7 @@ dbmopen(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
||||
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;
|
||||
@@ -177,4 +177,4 @@ skip_optional:
|
||||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=7f5d30ef5d820b8a input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=7ced103488cbca7a input=a9049054013a1b77]*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user