From 46e8ff63cb67a6520711da5317aaaef04d0414d0 Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Mon, 5 Oct 2015 11:59:43 -0700 Subject: Down-integrate from google internal. --- python/google/protobuf/pyext/descriptor_pool.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'python/google/protobuf/pyext/descriptor_pool.h') diff --git a/python/google/protobuf/pyext/descriptor_pool.h b/python/google/protobuf/pyext/descriptor_pool.h index 541d920b..eda73d38 100644 --- a/python/google/protobuf/pyext/descriptor_pool.h +++ b/python/google/protobuf/pyext/descriptor_pool.h @@ -89,12 +89,10 @@ const Descriptor* FindMessageTypeByName(PyDescriptorPool* self, const string& name); // Registers a new Python class for the given message descriptor. -// Returns the message Descriptor. -// On error, returns NULL with a Python exception set. -const Descriptor* RegisterMessageClass( - PyDescriptorPool* self, PyObject* message_class, PyObject* descriptor); - -// The function below are also exposed as methods of the DescriptorPool type. +// On error, returns -1 with a Python exception set. +int RegisterMessageClass(PyDescriptorPool* self, + const Descriptor* message_descriptor, + PyObject* message_class); // Retrieves the Python class registered with the given message descriptor. // @@ -103,6 +101,8 @@ const Descriptor* RegisterMessageClass( PyObject* GetMessageClass(PyDescriptorPool* self, const Descriptor* message_descriptor); +// The functions below are also exposed as methods of the DescriptorPool type. + // Looks up a message by name. Returns a PyMessageDescriptor corresponding to // the field on success, or NULL on failure. // @@ -136,8 +136,9 @@ PyObject* FindOneofByName(PyDescriptorPool* self, PyObject* arg); } // namespace cdescriptor_pool // Retrieve the global descriptor pool owned by the _message module. +// This is the one used by pb2.py generated modules. // Returns a *borrowed* reference. -PyDescriptorPool* GetDescriptorPool(); +PyDescriptorPool* GetDefaultDescriptorPool(); // Retrieve the python descriptor pool owning a C++ descriptor pool. // Returns a *borrowed* reference. -- cgit v1.2.3