Commit 79700b56 authored by Thomas Colthurst's avatar Thomas Colthurst Committed by Jie Luo

Update message_module.cc (#4835)

* Update message_module.cc

Add missing piece from pull request #4698:  actually initialize the new API object.

* Update message_module.cc
parent c5228890
......@@ -130,6 +130,15 @@ extern "C" {
Py_DECREF(m);
return INITFUNC_ERRORVAL;
}
// Adds the C++ API
if (PyObject* api =
PyCapsule_New(new ApiImplementation(),
google::protobuf::python::PyProtoAPICapsuleName(), NULL)) {
PyModule_AddObject(m, "proto_API", api);
} else {
return INITFUNC_ERRORVAL;
}
#if PY_MAJOR_VERSION >= 3
return m;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment