bpo-23867: Argument Clinic: inline parsing code for a single positional parameter. (GH-9689)
diff --git a/Python/clinic/marshal.c.h b/Python/clinic/marshal.c.h
index 0df4935..516a315 100644
--- a/Python/clinic/marshal.c.h
+++ b/Python/clinic/marshal.c.h
@@ -121,7 +121,11 @@
PyObject *return_value = NULL;
Py_buffer bytes = {NULL, NULL};
- if (!PyArg_Parse(arg, "y*:loads", &bytes)) {
+ if (PyObject_GetBuffer(arg, &bytes, PyBUF_SIMPLE) != 0) {
+ goto exit;
+ }
+ if (!PyBuffer_IsContiguous(&bytes, 'C')) {
+ _PyArg_BadArgument("loads", "contiguous buffer", arg);
goto exit;
}
return_value = marshal_loads_impl(module, &bytes);
@@ -134,4 +138,4 @@
return return_value;
}
-/*[clinic end generated code: output=cbb6128201bee7e0 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=8262e7e6c8cbc1ef input=a9049054013a1b77]*/