Skip to content

Commit

Permalink
py3 projection
Browse files Browse the repository at this point in the history
  • Loading branch information
bauman committed Oct 5, 2019
1 parent 77d2303 commit eca59a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bsonsearch/bsonhelpermodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ bson_as_string(PyObject* self, PyObject* args)

if (PyArg_ParseTuple(args, "L", &bson_object)){
const uint8_t *doc_bson = bson_get_data(bson_object);
#if PY_MAJOR_VERSION >= 3
PyObject * result = Py_BuildValue("y#", doc_bson, bson_object->len);
#else
PyObject * result = Py_BuildValue("s#", doc_bson, bson_object->len);
#endif
bson_destroy(bson_object);
bson_free(bson_object);
return result;
Expand Down

0 comments on commit eca59a8

Please sign in to comment.