key.c: Populate `KeyDataStructured' from the keywords.
[catacomb-python] / key.c
diff --git a/key.c b/key.c
index 177f01d..d97d632 100644 (file)
--- a/key.c
+++ b/key.c
@@ -1046,12 +1046,11 @@ static PyObject *keydatastruct_pynew(PyTypeObject *ty,
   PyObject *sub = 0;
   keydata_pyobj *me = 0;
   key_data *kd = 0;
-  static const char *const kwlist[] = { "subkeys", 0 };
 
-  if (!PyArg_ParseTupleAndKeywords(arg, kw, "|O:new", KWLIST, &sub))
-    goto end;
+  if (!PyArg_ParseTuple(arg, "|O:new", &sub)) goto end;
   kd = key_newstruct();
   if (sub && populate_struct(kd, sub)) goto end;
+  if (kw && populate_struct(kd, kw)) goto end;
   me = (keydata_pyobj *)ty->tp_alloc(ty, 0);
   me->gmops = &keydatastruct_gmops;
   me->kd = kd; kd = 0;