Skip to content

This code can be removed #124

@ghost

Description

 if (!PyBuffer_IsContiguous(&dest, 'C') || dest.ndim > 1) {
	PyErr_SetString(PyExc_ValueError,
	                "destination buffer should be contiguous and have at most one dimension");
	goto finally;
}

In PyArg_ParseTuple*() functions, the first condition has been checked.
w*:
https://github.com/python/cpython/blob/v3.5.0/Python/getargs.c#L1251
y*:
https://github.com/python/cpython/blob/v3.5.0/Python/getargs.c#L857
https://github.com/python/cpython/blob/v3.5.0/Python/getargs.c#L1306

The second condition is rare, even in Python's Argument Clinic, it is not checked for bytes-like object:
https://github.com/python/cpython/blob/3.9/Modules/clinic/_lzmamodule.c.h#L28-L34

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions