Skip to content

Commit

Permalink
python: make Object.from_bytes_ keyword-only arguments actually keywo…
Browse files Browse the repository at this point in the history
…rd-only

bit_offset and bit_field_size are annotated as keyword-only, but the
PyArg_ParseTupleAndKeywords() call is missing "$" in the format string.
Fix it.

Fixes: 9c00552 ("libdrgn: python: add Object.from_bytes_()")
Signed-off-by: Omar Sandoval <[email protected]>
  • Loading branch information
osandov committed Aug 29, 2024
1 parent be9f330 commit 269b7ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libdrgn/python/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ static DrgnObject *DrgnObject_from_bytes(PyTypeObject *type, PyObject *args,
Py_buffer bytes;
struct index_arg bit_offset = {};
struct index_arg bit_field_size = { .allow_none = true, .is_none = true };
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!Oy*|O&O&:from_bytes_",
if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!Oy*|$O&O&:from_bytes_",
keywords, &Program_type, &prog,
&type_obj, &bytes, index_converter,
&bit_offset, index_converter,
Expand Down

0 comments on commit 269b7ba

Please sign in to comment.