|
|
@ -197,15 +197,14 @@ static int AddDescriptors(PyObject* cls, const Descriptor* descriptor) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static PyObject* New(PyTypeObject* type, PyObject* args, PyObject* kwargs) { |
|
|
|
static PyObject* New(PyTypeObject* type, PyObject* args, PyObject* kwargs) { |
|
|
|
static const char *kwlist[] = {"name", "bases", "dict", 0}; |
|
|
|
static const char* kwlist[] = {"name", "bases", "dict", 0}; |
|
|
|
PyObject *bases, *dict; |
|
|
|
PyObject *bases, *dict; |
|
|
|
const char* name; |
|
|
|
const char* name; |
|
|
|
|
|
|
|
|
|
|
|
// Check arguments: (name, bases, dict)
|
|
|
|
// Check arguments: (name, bases, dict)
|
|
|
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "sO!O!:type", const_cast<char**>(kwlist), |
|
|
|
if (!PyArg_ParseTupleAndKeywords( |
|
|
|
&name, |
|
|
|
args, kwargs, "sO!O!:type", const_cast<char**>(kwlist), &name, |
|
|
|
&PyTuple_Type, &bases, |
|
|
|
&PyTuple_Type, &bases, &PyDict_Type, &dict)) { |
|
|
|
&PyDict_Type, &dict)) { |
|
|
|
|
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1680,10 +1679,10 @@ static PyObject* InternalSerializeToString( |
|
|
|
CMessage* self, PyObject* args, PyObject* kwargs, |
|
|
|
CMessage* self, PyObject* args, PyObject* kwargs, |
|
|
|
bool require_initialized) { |
|
|
|
bool require_initialized) { |
|
|
|
// Parse the "deterministic" kwarg; defaults to False.
|
|
|
|
// Parse the "deterministic" kwarg; defaults to False.
|
|
|
|
static const char* kwlist[] = { "deterministic", 0 }; |
|
|
|
static const char* kwlist[] = {"deterministic", 0}; |
|
|
|
PyObject* deterministic_obj = Py_None; |
|
|
|
PyObject* deterministic_obj = Py_None; |
|
|
|
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O", const_cast<char**>(kwlist), |
|
|
|
if (!PyArg_ParseTupleAndKeywords( |
|
|
|
&deterministic_obj)) { |
|
|
|
args, kwargs, "|O", const_cast<char**>(kwlist), &deterministic_obj)) { |
|
|
|
return NULL; |
|
|
|
return NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
// Preemptively convert to a bool first, so we don't need to back out of
|
|
|
|
// Preemptively convert to a bool first, so we don't need to back out of
|
|
|
|