| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,7 +66,7 @@ PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args); | |||
| 66 | 66 | #define _PyArg_NoPositional(funcname, args) \ | |
| 67 | 67 | ((args) == NULL || _PyArg_NoPositional((funcname), (args))) | |
| 68 | 68 | ||
| 69 | - PyAPI_FUNC(void) _PyArg_BadArgument(const char *, int, const char *, PyObject *); | ||
| 69 | + PyAPI_FUNC(void) _PyArg_BadArgument(const char *, const char *, const char *, PyObject *); | ||
| 70 | 70 | PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t, | |
| 71 | 71 | Py_ssize_t, Py_ssize_t); | |
| 72 | 72 | #define _PyArg_CheckPositional(funcname, nargs, min, max) \ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -286,7 +286,7 @@ def test_illegal(self): | |||
| 286 | 286 | self.fail() | |
| 287 | 287 | except TypeError as e: | |
| 288 | 288 | self.assertEqual(str(e), | |
| 289 | - 'ParserCreate() argument 2 must be str or None, not int') | ||
| 289 | + "ParserCreate() argument 'namespace_separator' must be str or None, not int") | ||
| 290 | 290 | ||
| 291 | 291 | try: | |
| 292 | 292 | expat.ParserCreate(namespace_separator='too long') | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,2 @@ | |||
| 1 | + Argument Clinic now uses the argument name on errors with keyword-only | ||
| 2 | + argument instead of their position. Patch contributed by Rémi Lapeyre. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,7 +72,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) | |||
| 72 | 72 | goto exit; | |
| 73 | 73 | } | |
| 74 | 74 | if (!PyBuffer_IsContiguous(&key, 'C')) { | |
| 75 | - _PyArg_BadArgument("blake2b", 3, "contiguous buffer", fastargs[2]); | ||
| 75 | + _PyArg_BadArgument("blake2b", "argument 'key'", "contiguous buffer", fastargs[2]); | ||
| 76 | 76 | goto exit; | |
| 77 | 77 | } | |
| 78 | 78 | if (!--noptargs) { | |
@@ -84,7 +84,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) | |||
| 84 | 84 | goto exit; | |
| 85 | 85 | } | |
| 86 | 86 | if (!PyBuffer_IsContiguous(&salt, 'C')) { | |
| 87 | - _PyArg_BadArgument("blake2b", 4, "contiguous buffer", fastargs[3]); | ||
| 87 | + _PyArg_BadArgument("blake2b", "argument 'salt'", "contiguous buffer", fastargs[3]); | ||
| 88 | 88 | goto exit; | |
| 89 | 89 | } | |
| 90 | 90 | if (!--noptargs) { | |
@@ -96,7 +96,7 @@ py_blake2b_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) | |||
| 96 | 96 | goto exit; | |
| 97 | 97 | } | |
| 98 | 98 | if (!PyBuffer_IsContiguous(&person, 'C')) { | |
| 99 | - _PyArg_BadArgument("blake2b", 5, "contiguous buffer", fastargs[4]); | ||
| 99 | + _PyArg_BadArgument("blake2b", "argument 'person'", "contiguous buffer", fastargs[4]); | ||
| 100 | 100 | goto exit; | |
| 101 | 101 | } | |
| 102 | 102 | if (!--noptargs) { | |
@@ -261,4 +261,4 @@ _blake2_blake2b_hexdigest(BLAKE2bObject *self, PyObject *Py_UNUSED(ignored)) | |||
| 261 | 261 | { | |
| 262 | 262 | return _blake2_blake2b_hexdigest_impl(self); | |
| 263 | 263 | } | |
| 264 | - /*[clinic end generated code: output=a91d182ce1109f34 input=a9049054013a1b77]*/ | ||
| 264 | + /*[clinic end generated code: output=cbb625d7f60c288c input=a9049054013a1b77]*/ | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,7 +72,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) | |||
| 72 | 72 | goto exit; | |
| 73 | 73 | } | |
| 74 | 74 | if (!PyBuffer_IsContiguous(&key, 'C')) { | |
| 75 | - _PyArg_BadArgument("blake2s", 3, "contiguous buffer", fastargs[2]); | ||
| 75 | + _PyArg_BadArgument("blake2s", "argument 'key'", "contiguous buffer", fastargs[2]); | ||
| 76 | 76 | goto exit; | |
| 77 | 77 | } | |
| 78 | 78 | if (!--noptargs) { | |
@@ -84,7 +84,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) | |||
| 84 | 84 | goto exit; | |
| 85 | 85 | } | |
| 86 | 86 | if (!PyBuffer_IsContiguous(&salt, 'C')) { | |
| 87 | - _PyArg_BadArgument("blake2s", 4, "contiguous buffer", fastargs[3]); | ||
| 87 | + _PyArg_BadArgument("blake2s", "argument 'salt'", "contiguous buffer", fastargs[3]); | ||
| 88 | 88 | goto exit; | |
| 89 | 89 | } | |
| 90 | 90 | if (!--noptargs) { | |
@@ -96,7 +96,7 @@ py_blake2s_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) | |||
| 96 | 96 | goto exit; | |
| 97 | 97 | } | |
| 98 | 98 | if (!PyBuffer_IsContiguous(&person, 'C')) { | |
| 99 | - _PyArg_BadArgument("blake2s", 5, "contiguous buffer", fastargs[4]); | ||
| 99 | + _PyArg_BadArgument("blake2s", "argument 'person'", "contiguous buffer", fastargs[4]); | ||
| 100 | 100 | goto exit; | |
| 101 | 101 | } | |
| 102 | 102 | if (!--noptargs) { | |
@@ -261,4 +261,4 @@ _blake2_blake2s_hexdigest(BLAKE2sObject *self, PyObject *Py_UNUSED(ignored)) | |||
| 261 | 261 | { | |
| 262 | 262 | return _blake2_blake2s_hexdigest_impl(self); | |
| 263 | 263 | } | |
| 264 | - /*[clinic end generated code: output=ae8e9b7301d092b4 input=a9049054013a1b77]*/ | ||
| 264 | + /*[clinic end generated code: output=39af5a74c8805b36 input=a9049054013a1b77]*/ | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -161,7 +161,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw | |||
| 161 | 161 | } | |
| 162 | 162 | if (args[1]) { | |
| 163 | 163 | if (!PyUnicode_Check(args[1])) { | |
| 164 | - _PyArg_BadArgument("open", 2, "str", args[1]); | ||
| 164 | + _PyArg_BadArgument("open", "argument 'mode'", "str", args[1]); | ||
| 165 | 165 | goto exit; | |
| 166 | 166 | } | |
| 167 | 167 | Py_ssize_t mode_length; | |
@@ -207,7 +207,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw | |||
| 207 | 207 | } | |
| 208 | 208 | } | |
| 209 | 209 | else { | |
| 210 | - _PyArg_BadArgument("open", 4, "str or None", args[3]); | ||
| 210 | + _PyArg_BadArgument("open", "argument 'encoding'", "str or None", args[3]); | ||
| 211 | 211 | goto exit; | |
| 212 | 212 | } | |
| 213 | 213 | if (!--noptargs) { | |
@@ -230,7 +230,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw | |||
| 230 | 230 | } | |
| 231 | 231 | } | |
| 232 | 232 | else { | |
| 233 | - _PyArg_BadArgument("open", 5, "str or None", args[4]); | ||
| 233 | + _PyArg_BadArgument("open", "argument 'errors'", "str or None", args[4]); | ||
| 234 | 234 | goto exit; | |
| 235 | 235 | } | |
| 236 | 236 | if (!--noptargs) { | |
@@ -253,7 +253,7 @@ _io_open(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *kw | |||
| 253 | 253 | } | |
| 254 | 254 | } | |
| 255 | 255 | else { | |
| 256 | - _PyArg_BadArgument("open", 6, "str or None", args[5]); | ||
| 256 | + _PyArg_BadArgument("open", "argument 'newline'", "str or None", args[5]); | ||
| 257 | 257 | goto exit; | |
| 258 | 258 | } | |
| 259 | 259 | if (!--noptargs) { | |
@@ -311,7 +311,7 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec | |||
| 311 | 311 | goto exit; | |
| 312 | 312 | } | |
| 313 | 313 | if (!PyUnicode_Check(args[0])) { | |
| 314 | - _PyArg_BadArgument("open_code", 1, "str", args[0]); | ||
| 314 | + _PyArg_BadArgument("open_code", "argument 'path'", "str", args[0]); | ||
| 315 | 315 | goto exit; | |
| 316 | 316 | } | |
| 317 | 317 | if (PyUnicode_READY(args[0]) == -1) { | |
@@ -323,4 +323,4 @@ _io_open_code(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObjec | |||
| 323 | 323 | exit: | |
| 324 | 324 | return return_value; | |
| 325 | 325 | } | |
| 326 | - /*[clinic end generated code: output=d479285078750d68 input=a9049054013a1b77]*/ | ||
| 326 | + /*[clinic end generated code: output=3df6bc6d91697545 input=a9049054013a1b77]*/ | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,11 +21,11 @@ _io__BufferedIOBase_readinto(PyObject *self, PyObject *arg) | |||
| 21 | 21 | ||
| 22 | 22 | if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { | |
| 23 | 23 | PyErr_Clear(); | |
| 24 | - _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg); | ||
| 24 | + _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg); | ||
| 25 | 25 | goto exit; | |
| 26 | 26 | } | |
| 27 | 27 | if (!PyBuffer_IsContiguous(&buffer, 'C')) { | |
| 28 | - _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg); | ||
| 28 | + _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg); | ||
| 29 | 29 | goto exit; | |
| 30 | 30 | } | |
| 31 | 31 | return_value = _io__BufferedIOBase_readinto_impl(self, &buffer); | |
@@ -58,11 +58,11 @@ _io__BufferedIOBase_readinto1(PyObject *self, PyObject *arg) | |||
| 58 | 58 | ||
| 59 | 59 | if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { | |
| 60 | 60 | PyErr_Clear(); | |
| 61 | - _PyArg_BadArgument("readinto1", 0, "read-write bytes-like object", arg); | ||
| 61 | + _PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg); | ||
| 62 | 62 | goto exit; | |
| 63 | 63 | } | |
| 64 | 64 | if (!PyBuffer_IsContiguous(&buffer, 'C')) { | |
| 65 | - _PyArg_BadArgument("readinto1", 0, "contiguous buffer", arg); | ||
| 65 | + _PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg); | ||
| 66 | 66 | goto exit; | |
| 67 | 67 | } | |
| 68 | 68 | return_value = _io__BufferedIOBase_readinto1_impl(self, &buffer); | |
@@ -243,11 +243,11 @@ _io__Buffered_readinto(buffered *self, PyObject *arg) | |||
| 243 | 243 | ||
| 244 | 244 | if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { | |
| 245 | 245 | PyErr_Clear(); | |
| 246 | - _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg); | ||
| 246 | + _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg); | ||
| 247 | 247 | goto exit; | |
| 248 | 248 | } | |
| 249 | 249 | if (!PyBuffer_IsContiguous(&buffer, 'C')) { | |
| 250 | - _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg); | ||
| 250 | + _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg); | ||
| 251 | 251 | goto exit; | |
| 252 | 252 | } | |
| 253 | 253 | return_value = _io__Buffered_readinto_impl(self, &buffer); | |
@@ -280,11 +280,11 @@ _io__Buffered_readinto1(buffered *self, PyObject *arg) | |||
| 280 | 280 | ||
| 281 | 281 | if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { | |
| 282 | 282 | PyErr_Clear(); | |
| 283 | - _PyArg_BadArgument("readinto1", 0, "read-write bytes-like object", arg); | ||
| 283 | + _PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg); | ||
| 284 | 284 | goto exit; | |
| 285 | 285 | } | |
| 286 | 286 | if (!PyBuffer_IsContiguous(&buffer, 'C')) { | |
| 287 | - _PyArg_BadArgument("readinto1", 0, "contiguous buffer", arg); | ||
| 287 | + _PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg); | ||
| 288 | 288 | goto exit; | |
| 289 | 289 | } | |
| 290 | 290 | return_value = _io__Buffered_readinto1_impl(self, &buffer); | |
@@ -538,7 +538,7 @@ _io_BufferedWriter_write(buffered *self, PyObject *arg) | |||
| 538 | 538 | goto exit; | |
| 539 | 539 | } | |
| 540 | 540 | if (!PyBuffer_IsContiguous(&buffer, 'C')) { | |
| 541 | - _PyArg_BadArgument("write", 0, "contiguous buffer", arg); | ||
| 541 | + _PyArg_BadArgument("write", "argument", "contiguous buffer", arg); | ||
| 542 | 542 | goto exit; | |
| 543 | 543 | } | |
| 544 | 544 | return_value = _io_BufferedWriter_write_impl(self, &buffer); | |
@@ -672,4 +672,4 @@ _io_BufferedRandom___init__(PyObject *self, PyObject *args, PyObject *kwargs) | |||
| 672 | 672 | exit: | |
| 673 | 673 | return return_value; | |
| 674 | 674 | } | |
| 675 | - /*[clinic end generated code: output=b22b4aedd53c340a input=a9049054013a1b77]*/ | ||
| 675 | + /*[clinic end generated code: output=7246104f6c7d3167 input=a9049054013a1b77]*/ | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -319,11 +319,11 @@ _io_BytesIO_readinto(bytesio *self, PyObject *arg) | |||
| 319 | 319 | ||
| 320 | 320 | if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { | |
| 321 | 321 | PyErr_Clear(); | |
| 322 | - _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg); | ||
| 322 | + _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg); | ||
| 323 | 323 | goto exit; | |
| 324 | 324 | } | |
| 325 | 325 | if (!PyBuffer_IsContiguous(&buffer, 'C')) { | |
| 326 | - _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg); | ||
| 326 | + _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg); | ||
| 327 | 327 | goto exit; | |
| 328 | 328 | } | |
| 329 | 329 | return_value = _io_BytesIO_readinto_impl(self, &buffer); | |
@@ -515,4 +515,4 @@ _io_BytesIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) | |||
| 515 | 515 | exit: | |
| 516 | 516 | return return_value; | |
| 517 | 517 | } | |
| 518 | - /*[clinic end generated code: output=22e8fb54874b6ee5 input=a9049054013a1b77]*/ | ||
| 518 | + /*[clinic end generated code: output=4ec2506def9c8eb9 input=a9049054013a1b77]*/ | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,7 +70,7 @@ _io_FileIO___init__(PyObject *self, PyObject *args, PyObject *kwargs) | |||
| 70 | 70 | } | |
| 71 | 71 | if (fastargs[1]) { | |
| 72 | 72 | if (!PyUnicode_Check(fastargs[1])) { | |
| 73 | - _PyArg_BadArgument("FileIO", 2, "str", fastargs[1]); | ||
| 73 | + _PyArg_BadArgument("FileIO", "argument 'mode'", "str", fastargs[1]); | ||
| 74 | 74 | goto exit; | |
| 75 | 75 | } | |
| 76 | 76 | Py_ssize_t mode_length; | |
@@ -200,11 +200,11 @@ _io_FileIO_readinto(fileio *self, PyObject *arg) | |||
| 200 | 200 | ||
| 201 | 201 | if (PyObject_GetBuffer(arg, &buffer, PyBUF_WRITABLE) < 0) { | |
| 202 | 202 | PyErr_Clear(); | |
| 203 | - _PyArg_BadArgument("readinto", 0, "read-write bytes-like object", arg); | ||
| 203 | + _PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg); | ||
| 204 | 204 | goto exit; | |
| 205 | 205 | } | |
| 206 | 206 | if (!PyBuffer_IsContiguous(&buffer, 'C')) { | |
| 207 | - _PyArg_BadArgument("readinto", 0, "contiguous buffer", arg); | ||
| 207 | + _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg); | ||
| 208 | 208 | goto exit; | |
| 209 | 209 | } | |
| 210 | 210 | return_value = _io_FileIO_readinto_impl(self, &buffer); | |
@@ -303,7 +303,7 @@ _io_FileIO_write(fileio *self, PyObject *arg) | |||
| 303 | 303 | goto exit; | |
| 304 | 304 | } | |
| 305 | 305 | if (!PyBuffer_IsContiguous(&b, 'C')) { | |
| 306 | - _PyArg_BadArgument("write", 0, "contiguous buffer", arg); | ||
| 306 | + _PyArg_BadArgument("write", "argument", "contiguous buffer", arg); | ||
| 307 | 307 | goto exit; | |
| 308 | 308 | } | |
| 309 | 309 | return_value = _io_FileIO_write_impl(self, &b); | |
@@ -447,4 +447,4 @@ _io_FileIO_isatty(fileio *self, PyObject *Py_UNUSED(ignored)) | |||
| 447 | 447 | #ifndef _IO_FILEIO_TRUNCATE_METHODDEF | |
| 448 | 448 | #define _IO_FILEIO_TRUNCATE_METHODDEF | |
| 449 | 449 | #endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */ | |
| 450 | - /*[clinic end generated code: output=7ee4f3ae584fc6d2 input=a9049054013a1b77]*/ | ||
| 450 | + /*[clinic end generated code: output=a7e9cca3613660fb input=a9049054013a1b77]*/ | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments