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
pull/4872/head
Thomas Colthurst 7 years ago committed by Jie Luo
parent c522889038
commit 79700b56b9
  1. 9
      python/google/protobuf/pyext/message_module.cc

@ -130,6 +130,15 @@ extern "C" {
Py_DECREF(m); Py_DECREF(m);
return INITFUNC_ERRORVAL; 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 #if PY_MAJOR_VERSION >= 3
return m; return m;

Loading…
Cancel
Save