Keyword creation in a module function

Hey Gang, I have come across the need to pass both keywords and arguments from one function to another. The keywords are passing just fine with a PyObjectCall command. However, if the user does not specify any keywords at the interpretor, the command will seg-fault. The docs state that keywords argument can be NULL, but this does not work with NULL set objects. How do I build a keywords dictionary which can function correctly if there are none to start with or if the user defined some? I am thinking it can be done with a PyDict() like command?
The below snippet is the scenario I am trying to achieve -->
if ( kwds ) { self->c_surface = PyObject_Call((PyObject *) &PyMyObject_Type, object_args, kwds); } else { self->c_surface = PyObject_Call((PyObject *) &PyMyObject_Type, object_args, NULL); }
-- Bust0ut, Surgemcgee: Systems Engineer --- surgemcgee.com Django_Teamplate3d
participants (1)
-
Robert Steckroth