Make C and Python _dict_to_bson consistent PYTHON-380
This commit is contained in:
parent
60188ad23e
commit
8ef1bd5daf
@ -1040,9 +1040,11 @@ static PyObject* _cbson_dict_to_bson(PyObject* self, PyObject* args) {
|
||||
PyObject* result;
|
||||
unsigned char check_keys;
|
||||
unsigned char uuid_subtype;
|
||||
unsigned char top_level = 1;
|
||||
buffer_t buffer;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "Obb", &dict, &check_keys, &uuid_subtype)) {
|
||||
if (!PyArg_ParseTuple(args, "Obb|b", &dict,
|
||||
&check_keys, &uuid_subtype, &top_level)) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1052,7 +1054,7 @@ static PyObject* _cbson_dict_to_bson(PyObject* self, PyObject* args) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!write_dict(self, buffer, dict, check_keys, uuid_subtype, 1)) {
|
||||
if (!write_dict(self, buffer, dict, check_keys, uuid_subtype, top_level)) {
|
||||
buffer_free(buffer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user