From 6aebf117f447fcab76c0f92b3ce122d4ef3337fc Mon Sep 17 00:00:00 2001 From: "A. Jesse Jiryu Davis" Date: Fri, 30 Mar 2012 16:27:19 -0400 Subject: [PATCH] Fix bug serializing code objects w/ scope --- bson/_cbsonmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bson/_cbsonmodule.c b/bson/_cbsonmodule.c index 8d1749f54..e89e91802 100644 --- a/bson/_cbsonmodule.c +++ b/bson/_cbsonmodule.c @@ -506,7 +506,7 @@ static int _write_element_to_buffer(PyObject* self, buffer_t buffer, int type_by return 0; } - if (!PyObject_Size(scope)) { + if (!PyDict_Size(scope)) { Py_DECREF(scope); *(buffer_get_buffer(buffer) + type_byte) = 0x0D;