mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2026-08-27 00:26:02 -04:00
gdb/python: keyword args for Color.__init__
GDB's Python API documentation is clear:
Functions and methods which have two or more optional arguments allow
them to be specified using keyword syntax.
The gdb.Color.__init__ method matches this description, but doesn't
support keyword arguments.
This commit fixes this by adding keyword argument support.
There's a new test to cover this functionality.
Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
parent
94f3facb21
commit
2eead96aeb
2 changed files with 17 additions and 2 deletions
|
|
@ -176,7 +176,10 @@ colorpy_init (PyObject *self, PyObject *args, PyObject *kwds)
|
|||
PyObject *colorspace_obj = nullptr;
|
||||
color_space colorspace = color_space::MONOCHROME;
|
||||
|
||||
if (!PyArg_ParseTuple (args, "|OO", &value_obj, &colorspace_obj))
|
||||
static const char *keywords[] = { "value", "color_space", nullptr };
|
||||
|
||||
if (!gdb_PyArg_ParseTupleAndKeywords (args, kwds, "|OO", keywords,
|
||||
&value_obj, &colorspace_obj))
|
||||
return -1;
|
||||
|
||||
try
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue