--- /dev/null
+Remove redundant C-contiguity check in :file:`getargs.c`, :mod:`binascii`, :mod:`ssl` and Argument Clinic. Patched by Stefan Krah and Furkan Onder
if (PyObject_GetBuffer(fastargs[2], &key, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&key, 'C')) {
- _PyArg_BadArgument("blake2b", "argument 'key'", "contiguous buffer", fastargs[2]);
- goto exit;
- }
if (!--noptargs) {
goto skip_optional_kwonly;
}
if (PyObject_GetBuffer(fastargs[3], &salt, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&salt, 'C')) {
- _PyArg_BadArgument("blake2b", "argument 'salt'", "contiguous buffer", fastargs[3]);
- goto exit;
- }
if (!--noptargs) {
goto skip_optional_kwonly;
}
if (PyObject_GetBuffer(fastargs[4], &person, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&person, 'C')) {
- _PyArg_BadArgument("blake2b", "argument 'person'", "contiguous buffer", fastargs[4]);
- goto exit;
- }
if (!--noptargs) {
goto skip_optional_kwonly;
}
{
return _blake2_blake2b_hexdigest_impl(self);
}
-/*[clinic end generated code: output=19b82b55c033d895 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e18eeaee40623bfc input=a9049054013a1b77]*/
if (PyObject_GetBuffer(fastargs[2], &key, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&key, 'C')) {
- _PyArg_BadArgument("blake2s", "argument 'key'", "contiguous buffer", fastargs[2]);
- goto exit;
- }
if (!--noptargs) {
goto skip_optional_kwonly;
}
if (PyObject_GetBuffer(fastargs[3], &salt, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&salt, 'C')) {
- _PyArg_BadArgument("blake2s", "argument 'salt'", "contiguous buffer", fastargs[3]);
- goto exit;
- }
if (!--noptargs) {
goto skip_optional_kwonly;
}
if (PyObject_GetBuffer(fastargs[4], &person, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&person, 'C')) {
- _PyArg_BadArgument("blake2s", "argument 'person'", "contiguous buffer", fastargs[4]);
- goto exit;
- }
if (!--noptargs) {
goto skip_optional_kwonly;
}
{
return _blake2_blake2s_hexdigest_impl(self);
}
-/*[clinic end generated code: output=79b3479e90f4d077 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=24690e4e2586cafd input=a9049054013a1b77]*/
_PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = _io__BufferedIOBase_readinto_impl(self, &buffer);
exit:
_PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg);
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = _io__BufferedIOBase_readinto1_impl(self, &buffer);
exit:
_PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = _io__Buffered_readinto_impl(self, &buffer);
exit:
_PyArg_BadArgument("readinto1", "argument", "read-write bytes-like object", arg);
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto1", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = _io__Buffered_readinto1_impl(self, &buffer);
exit:
if (PyObject_GetBuffer(arg, &buffer, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = _io_BufferedWriter_write_impl(self, &buffer);
exit:
exit:
return return_value;
}
-/*[clinic end generated code: output=b83f65fad0cd5fb6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=090e70253e35fc22 input=a9049054013a1b77]*/
_PyArg_BadArgument("readinto", "argument", "read-write bytes-like object", arg);
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = _io_BytesIO_readinto_impl(self, &buffer);
exit:
exit:
return return_value;
}
-/*[clinic end generated code: output=27333725edff70a0 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2be0e05a8871b7e2 input=a9049054013a1b77]*/
_PyArg_BadArgument("readinto", "argument 1", "read-write bytes-like object", args[0]);
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
return_value = _io_FileIO_readinto_impl(self, cls, &buffer);
exit:
if (PyObject_GetBuffer(args[0], &b, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&b, 'C')) {
- _PyArg_BadArgument("write", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
return_value = _io_FileIO_write_impl(self, cls, &b);
exit:
#ifndef _IO_FILEIO_TRUNCATE_METHODDEF
#define _IO_FILEIO_TRUNCATE_METHODDEF
#endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */
-/*[clinic end generated code: output=10838003d15e7b3d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1c0f4a36f76b0c6a input=a9049054013a1b77]*/
_PyArg_BadArgument("readinto", "argument 1", "read-write bytes-like object", args[0]);
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("readinto", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
return_value = _io__WindowsConsoleIO_readinto_impl(self, cls, &buffer);
exit:
if (PyObject_GetBuffer(args[0], &b, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&b, 'C')) {
- _PyArg_BadArgument("write", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
return_value = _io__WindowsConsoleIO_write_impl(self, cls, &b);
exit:
#ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
#define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
#endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */
-/*[clinic end generated code: output=2debef253fa1ab90 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=04108fc26b187386 input=a9049054013a1b77]*/
if (PyObject_GetBuffer(args[1], &buf, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&buf, 'C')) {
- _PyArg_BadArgument("send", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
return_value = _multiprocessing_send_impl(module, handle, &buf);
exit:
#ifndef _MULTIPROCESSING_SEND_METHODDEF
#define _MULTIPROCESSING_SEND_METHODDEF
#endif /* !defined(_MULTIPROCESSING_SEND_METHODDEF) */
-/*[clinic end generated code: output=48504f7a2d37958c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=73b4cb8428d816da input=a9049054013a1b77]*/
if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = blob_write_impl(self, &data);
exit:
exit:
return return_value;
}
-/*[clinic end generated code: output=27c24afc687bd772 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=31abd55660e0c5af input=a9049054013a1b77]*/
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("deserialize", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
}
if (!noptargs) {
goto skip_optional_kwonly;
#ifndef DESERIALIZE_METHODDEF
#define DESERIALIZE_METHODDEF
#endif /* !defined(DESERIALIZE_METHODDEF) */
-/*[clinic end generated code: output=b9c27a406e329587 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=90b5b9c14261b8d7 input=a9049054013a1b77]*/
if (PyObject_GetBuffer(cadata, &buf, PyBUF_SIMPLE)) {
goto error;
}
- if (!PyBuffer_IsContiguous(&buf, 'C') || buf.ndim > 1) {
+ assert(PyBuffer_IsContiguous(&buf, 'C'));
+ if (buf.ndim > 1) {
PyBuffer_Release(&buf);
PyErr_SetString(PyExc_TypeError,
"cadata should be a contiguous buffer with "
"not '%.100s'", Py_TYPE(arg)->tp_name);
return 0;
}
- if (!PyBuffer_IsContiguous(buf, 'C')) {
- PyErr_Format(PyExc_TypeError,
- "argument should be a contiguous buffer, "
- "not '%.100s'", Py_TYPE(arg)->tp_name);
- PyBuffer_Release(buf);
- return 0;
- }
+ assert(PyBuffer_IsContiguous(buf, 'C'));
return Py_CLEANUP_SUPPORTED;
}
if (PyObject_GetBuffer(args[0], &input, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&input, 'C')) {
- _PyArg_BadArgument("decode", "argument 'input'", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
if (PyObject_GetBuffer(args[0], &input, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&input, 'C')) {
- _PyArg_BadArgument("decode", "argument 'input'", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
#define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \
{"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
-/*[clinic end generated code: output=38f8d42721eea1e6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=219a363662d2fbff input=a9049054013a1b77]*/
if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("compress", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = _bz2_BZ2Compressor_compress_impl(self, &data);
exit:
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("decompress", "argument 'data'", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
exit:
return return_value;
}
-/*[clinic end generated code: output=90f7b5c451c0a8bf input=a9049054013a1b77]*/
+/*[clinic end generated code: output=8daa62f47cc4853d input=a9049054013a1b77]*/
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("escape_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
}
if (nargs < 2) {
goto skip_optional;
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_7_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_8_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_16_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_16_le_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_16_be_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_16_ex_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_32_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_32_le_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_32_be_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("utf_32_ex_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("unicode_escape_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
}
if (nargs < 2) {
goto skip_optional;
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("raw_unicode_escape_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
}
if (nargs < 2) {
goto skip_optional;
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("latin_1_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("ascii_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("charmap_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("mbcs_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("oem_decode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[1], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("code_page_decode", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
if (nargs < 3) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("readbuffer_encode", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
}
if (nargs < 2) {
goto skip_optional;
#ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF
#define _CODECS_CODE_PAGE_ENCODE_METHODDEF
#endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */
-/*[clinic end generated code: output=40cf63bf2da18359 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d8d9e372f7ccba35 input=a9049054013a1b77]*/
if (PyObject_GetBuffer(args[1], &password, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&password, 'C')) {
- _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", "argument 'salt'", "contiguous buffer", args[2]);
- goto exit;
- }
iterations = PyLong_AsLong(args[3]);
if (iterations == -1 && PyErr_Occurred()) {
goto exit;
if (PyObject_GetBuffer(args[0], &password, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&password, 'C')) {
- _PyArg_BadArgument("scrypt", "argument 'password'", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_kwonly;
}
if (PyObject_GetBuffer(args[1], &salt, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&salt, 'C')) {
- _PyArg_BadArgument("scrypt", "argument 'salt'", "contiguous buffer", args[1]);
- goto exit;
- }
if (!--noptargs) {
goto skip_optional_kwonly;
}
if (PyObject_GetBuffer(args[0], &key, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&key, 'C')) {
- _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", "argument 'msg'", "contiguous buffer", args[1]);
- goto exit;
- }
digest = args[2];
return_value = _hashlib_hmac_singleshot_impl(module, &key, &msg, digest);
if (PyObject_GetBuffer(args[0], &key, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&key, 'C')) {
- _PyArg_BadArgument("hmac_new", "argument 'key'", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
#ifndef _HASHLIB_SCRYPT_METHODDEF
#define _HASHLIB_SCRYPT_METHODDEF
#endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */
-/*[clinic end generated code: output=21ad88d46922dc00 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b7eddeb3d6ccdeec input=a9049054013a1b77]*/
if (PyObject_GetBuffer(arg, &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("compress", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = _lzma_LZMACompressor_compress_impl(self, &data);
exit:
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("decompress", "argument 'data'", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
if (PyObject_GetBuffer(args[1], &encoded_props, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&encoded_props, 'C')) {
- _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);
exit:
return return_value;
}
-/*[clinic end generated code: output=fca7d2b5800dc4c1 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5e79c05ace76dc96 input=a9049054013a1b77]*/
if (PyObject_GetBuffer(arg, &b, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&b, 'C')) {
- _PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = _ssl__SSLSocket_write_impl(self, &b);
exit:
if (PyObject_GetBuffer(arg, &protos, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&protos, 'C')) {
- _PyArg_BadArgument("_set_alpn_protocols", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = _ssl__SSLContext__set_alpn_protocols_impl(self, &protos);
exit:
if (PyObject_GetBuffer(arg, &b, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&b, 'C')) {
- _PyArg_BadArgument("write", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = _ssl_MemoryBIO_write_impl(self, &b);
exit:
if (PyObject_GetBuffer(args[0], &view, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&view, 'C')) {
- _PyArg_BadArgument("RAND_add", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
}
if (PyFloat_CheckExact(args[1])) {
entropy = PyFloat_AS_DOUBLE(args[1]);
#ifndef _SSL_ENUM_CRLS_METHODDEF
#define _SSL_ENUM_CRLS_METHODDEF
#endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */
-/*[clinic end generated code: output=f15635b2faa3b2db input=a9049054013a1b77]*/
+/*[clinic end generated code: output=aa6b0a898b6077fe input=a9049054013a1b77]*/
if (PyObject_GetBuffer(arg, &buffer, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("unpack", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = Struct_unpack_impl(self, &buffer);
exit:
if (PyObject_GetBuffer(args[0], &buffer, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("unpack_from", "argument 'buffer'", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
if (PyObject_GetBuffer(args[1], &buffer, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("unpack", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
return_value = unpack_impl(module, s_object, &buffer);
exit:
if (PyObject_GetBuffer(args[1], &buffer, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("unpack_from", "argument 'buffer'", "contiguous buffer", args[1]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
return return_value;
}
-/*[clinic end generated code: output=1749aaf639d5c11c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=6a20e87f9b298b14 input=a9049054013a1b77]*/
if (PyObject_GetBuffer(arg, &buffer, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("frombytes", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = array_array_frombytes_impl(self, &buffer);
exit:
#define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \
{"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__},
-/*[clinic end generated code: output=d58693e1157540ef input=a9049054013a1b77]*/
+/*[clinic end generated code: output=bf086c01e7e482bf input=a9049054013a1b77]*/
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("b2a_uu", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_kwonly;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("b2a_base64", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_kwonly;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("crc_hqx", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
crc = (unsigned int)PyLong_AsUnsignedLongMask(args[1]);
if (crc == (unsigned int)-1 && PyErr_Occurred()) {
goto exit;
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("crc32", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("b2a_hex", "argument 'data'", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("hexlify", "argument 'data'", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("b2a_qp", "argument 'data'", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
return return_value;
}
-/*[clinic end generated code: output=3259f3b018abee96 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=968767b663ed889d input=a9049054013a1b77]*/
if (PyObject_GetBuffer(args[1], &bufobj, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&bufobj, 'C')) {
- _PyArg_BadArgument("ReadFileInto", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
return_value = _overlapped_Overlapped_ReadFileInto_impl(self, handle, &bufobj);
exit:
if (PyObject_GetBuffer(args[1], &bufobj, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&bufobj, 'C')) {
- _PyArg_BadArgument("WSARecvInto", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
if (!_PyLong_UnsignedLong_Converter(args[2], &flags)) {
goto exit;
}
if (PyObject_GetBuffer(args[1], &bufobj, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&bufobj, 'C')) {
- _PyArg_BadArgument("WriteFile", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
return_value = _overlapped_Overlapped_WriteFile_impl(self, handle, &bufobj);
exit:
if (PyObject_GetBuffer(args[1], &bufobj, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&bufobj, 'C')) {
- _PyArg_BadArgument("WSASend", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
if (!_PyLong_UnsignedLong_Converter(args[2], &flags)) {
goto exit;
}
if (PyObject_GetBuffer(args[1], &bufobj, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&bufobj, 'C')) {
- _PyArg_BadArgument("WSASendTo", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
if (!_PyLong_UnsignedLong_Converter(args[2], &flags)) {
goto exit;
}
if (PyObject_GetBuffer(args[1], &bufobj, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&bufobj, 'C')) {
- _PyArg_BadArgument("WSARecvFromInto", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
if (!_PyLong_UnsignedLong_Converter(args[2], &size)) {
goto exit;
}
return return_value;
}
-/*[clinic end generated code: output=85884c2341fcbef7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=958cbddbcc355f47 input=a9049054013a1b77]*/
if (PyObject_GetBuffer(args[1], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("write", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
_return_value = os_write_impl(module, fd, &data);
if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
if (PyObject_GetBuffer(args[1], &buffer, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&buffer, 'C')) {
- _PyArg_BadArgument("pwrite", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
if (!Py_off_t_converter(args[2], &offset)) {
goto exit;
}
if (PyObject_GetBuffer(args[2], &value, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&value, 'C')) {
- _PyArg_BadArgument("setxattr", "argument 'value'", "contiguous buffer", args[2]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
#ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#define OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */
-/*[clinic end generated code: output=274174066fff3256 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a05abdc48e3def44 input=a9049054013a1b77]*/
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("compress", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("decompress", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
if (PyObject_GetBuffer(args[5], &zdict, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&zdict, 'C')) {
- _PyArg_BadArgument("compressobj", "argument 'zdict'", "contiguous buffer", args[5]);
- goto exit;
- }
skip_optional_pos:
return_value = zlib_compressobj_impl(module, level, method, wbits, memLevel, strategy, &zdict);
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("compress", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
return_value = zlib_Compress_compress_impl(self, cls, &data);
exit:
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("decompress", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("decompress", "argument 'data'", "contiguous buffer", args[0]);
- goto exit;
- }
if (!noptargs) {
goto skip_optional_pos;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("adler32", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
if (PyObject_GetBuffer(args[0], &data, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&data, 'C')) {
- _PyArg_BadArgument("crc32", "argument 1", "contiguous buffer", args[0]);
- goto exit;
- }
if (nargs < 2) {
goto skip_optional;
}
#ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
#define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
#endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */
-/*[clinic end generated code: output=bd96ba786b0d8d42 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=6dd97dc851c39031 input=a9049054013a1b77]*/
if (PyObject_GetBuffer(arg, &prefix, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&prefix, 'C')) {
- _PyArg_BadArgument("removeprefix", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = bytearray_removeprefix_impl(self, &prefix);
exit:
if (PyObject_GetBuffer(arg, &suffix, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&suffix, 'C')) {
- _PyArg_BadArgument("removesuffix", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = bytearray_removesuffix_impl(self, &suffix);
exit:
if (PyObject_GetBuffer(args[0], &frm, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&frm, 'C')) {
- _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", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
return_value = bytearray_maketrans_impl(&frm, &to);
exit:
if (PyObject_GetBuffer(args[0], &old, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&old, 'C')) {
- _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", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
if (nargs < 3) {
goto skip_optional;
}
{
return bytearray_sizeof_impl(self);
}
-/*[clinic end generated code: output=fc2b9ccabe0e6782 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=0797a5e03cda2a16 input=a9049054013a1b77]*/
if (PyObject_GetBuffer(arg, &sep, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&sep, 'C')) {
- _PyArg_BadArgument("partition", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = bytes_partition_impl(self, &sep);
exit:
if (PyObject_GetBuffer(arg, &sep, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&sep, 'C')) {
- _PyArg_BadArgument("rpartition", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = bytes_rpartition_impl(self, &sep);
exit:
if (PyObject_GetBuffer(args[0], &frm, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&frm, 'C')) {
- _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", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
return_value = bytes_maketrans_impl(&frm, &to);
exit:
if (PyObject_GetBuffer(args[0], &old, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&old, 'C')) {
- _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", "argument 2", "contiguous buffer", args[1]);
- goto exit;
- }
if (nargs < 3) {
goto skip_optional;
}
if (PyObject_GetBuffer(arg, &prefix, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&prefix, 'C')) {
- _PyArg_BadArgument("removeprefix", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = bytes_removeprefix_impl(self, &prefix);
exit:
if (PyObject_GetBuffer(arg, &suffix, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&suffix, 'C')) {
- _PyArg_BadArgument("removesuffix", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = bytes_removesuffix_impl(self, &suffix);
exit:
exit:
return return_value;
}
-/*[clinic end generated code: output=da013a7e257f5c6e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=8a49dbbd78914a6f input=a9049054013a1b77]*/
if (PyObject_GetBuffer(args[1], &source, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&source, 'C')) {
- _PyArg_BadArgument("source_hash", "argument 'source'", "contiguous buffer", args[1]);
- goto exit;
- }
return_value = _imp_source_hash_impl(module, key, &source);
exit:
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
#define _IMP_EXEC_DYNAMIC_METHODDEF
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
-/*[clinic end generated code: output=c37ad1bf06f9e947 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=dbd63707bd40b07c input=a9049054013a1b77]*/
if (PyObject_GetBuffer(arg, &bytes, PyBUF_SIMPLE) != 0) {
goto exit;
}
- if (!PyBuffer_IsContiguous(&bytes, 'C')) {
- _PyArg_BadArgument("loads", "argument", "contiguous buffer", arg);
- goto exit;
- }
return_value = marshal_loads_impl(module, &bytes);
exit:
return return_value;
}
-/*[clinic end generated code: output=99ba446b1a75a269 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=92d2d47aac9128ee input=a9049054013a1b77]*/
arg, msgbuf, bufsize);
format++;
- /* Caller is interested in Py_buffer, and the object
- supports it directly. */
+ /* Caller is interested in Py_buffer, and the object supports it
+ directly. The request implicitly asks for PyBUF_SIMPLE, so the
+ result is C-contiguous with format 'B'. */
if (PyObject_GetBuffer(arg, (Py_buffer*)p, PyBUF_WRITABLE) < 0) {
PyErr_Clear();
return converterr("read-write bytes-like object",
arg, msgbuf, bufsize);
}
- if (!PyBuffer_IsContiguous((Py_buffer*)p, 'C')) {
- PyBuffer_Release((Py_buffer*)p);
- return converterr("contiguous buffer", arg, msgbuf, bufsize);
- }
+ assert(PyBuffer_IsContiguous((Py_buffer *)p, 'C'));
if (addcleanup(p, freelist, cleanup_buffer)) {
return converterr(
"(cleanup problem)",
static int
getbuffer(PyObject *arg, Py_buffer *view, const char **errmsg)
{
+ /* PyBUF_SIMPLE implies C-contiguous */
if (PyObject_GetBuffer(arg, view, PyBUF_SIMPLE) != 0) {
*errmsg = "bytes-like object";
return -1;
}
- if (!PyBuffer_IsContiguous(view, 'C')) {
- PyBuffer_Release(view);
- *errmsg = "contiguous buffer";
- return -1;
- }
+ assert(PyBuffer_IsContiguous(view, 'C'));
return 0;
}
return "".join(["if (", name, ".obj) {\n PyBuffer_Release(&", name, ");\n}\n"])
def parse_arg(self, argname: str, displayname: str, *, limited_capi: bool) -> str | None:
+ # PyBUF_SIMPLE guarantees that the format units of the buffers are C-contiguous.
if self.format_unit == 'y*':
return self.format_code("""
if (PyObject_GetBuffer({argname}, &{paramname}, PyBUF_SIMPLE) != 0) {{{{
goto exit;
}}}}
- if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{
- {bad_argument}
- goto exit;
- }}}}
""",
argname=argname,
bad_argument=self.bad_argument(displayname, 'contiguous buffer', limited_capi=limited_capi),
if (PyObject_GetBuffer({argname}, &{paramname}, PyBUF_SIMPLE) != 0) {{{{
goto exit;
}}}}
- if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{
- {bad_argument}
- goto exit;
- }}}}
}}}}
""",
argname=argname,
{bad_argument}
goto exit;
}}}}
- if (!PyBuffer_IsContiguous(&{paramname}, 'C')) {{{{
- {bad_argument2}
- goto exit;
- }}}}
""",
argname=argname,
bad_argument=self.bad_argument(displayname, 'read-write bytes-like object', limited_capi=limited_capi),