diff options
author | 2016-11-17 16:48:38 -0800 | |
---|---|---|
committer | 2016-11-17 16:59:59 -0800 | |
commit | 5a76e633ea9b5adb215e93fdc11e1c0c08b3fc74 (patch) | |
tree | 0276f81f8848a05d84cd7e287b43d665e30f04e3 /python/google/protobuf/pyext/message_factory.h | |
parent | e28286fa05d8327fd6c5aa70cfb3be558f0932b8 (diff) |
Integrated internal changes from Google
Diffstat (limited to 'python/google/protobuf/pyext/message_factory.h')
-rw-r--r-- | python/google/protobuf/pyext/message_factory.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/python/google/protobuf/pyext/message_factory.h b/python/google/protobuf/pyext/message_factory.h index 07cccbfb..36092f7e 100644 --- a/python/google/protobuf/pyext/message_factory.h +++ b/python/google/protobuf/pyext/message_factory.h @@ -82,14 +82,14 @@ PyMessageFactory* NewMessageFactory(PyTypeObject* type, PyDescriptorPool* pool); int RegisterMessageClass(PyMessageFactory* self, const Descriptor* message_descriptor, CMessageClass* message_class); - -// Retrieves the Python class registered with the given message descriptor. -// -// Returns a *borrowed* reference if found, otherwise returns NULL with an -// exception set. +// Retrieves the Python class registered with the given message descriptor, or +// fail with a TypeError. Returns a *borrowed* reference. CMessageClass* GetMessageClass(PyMessageFactory* self, const Descriptor* message_descriptor); - +// Retrieves the Python class registered with the given message descriptor. +// The class is created if not done yet. Returns a *new* reference. +CMessageClass* GetOrCreateMessageClass(PyMessageFactory* self, + const Descriptor* message_descriptor); } // namespace message_factory // Initialize objects used by this module. |