Index: third_party/protobuf/python/google/protobuf/message_factory.py |
diff --git a/third_party/protobuf/python/google/protobuf/message_factory.py b/third_party/protobuf/python/google/protobuf/message_factory.py |
index 1b059d130b5ab6ab4ada1a087723dc1d33c94c47..8ab1c513d1c1464db825a4f330493981a3c08cc0 100644 |
--- a/third_party/protobuf/python/google/protobuf/message_factory.py |
+++ b/third_party/protobuf/python/google/protobuf/message_factory.py |
@@ -103,13 +103,8 @@ class MessageFactory(object): |
result = {} |
for file_name in files: |
file_desc = self.pool.FindFileByName(file_name) |
- for name, msg in file_desc.message_types_by_name.items(): |
- if file_desc.package: |
- full_name = '.'.join([file_desc.package, name]) |
- else: |
- full_name = msg.name |
- result[full_name] = self.GetPrototype( |
- self.pool.FindMessageTypeByName(full_name)) |
+ for desc in file_desc.message_types_by_name.values(): |
+ result[desc.full_name] = self.GetPrototype(desc) |
# While the extension FieldDescriptors are created by the descriptor pool, |
# the python classes created in the factory need them to be registered |
@@ -120,7 +115,7 @@ class MessageFactory(object): |
# ignore the registration if the original was the same, or raise |
# an error if they were different. |
- for name, extension in file_desc.extensions_by_name.items(): |
+ for extension in file_desc.extensions_by_name.values(): |
if extension.containing_type.full_name not in self._classes: |
self.GetPrototype(extension.containing_type) |
extended_class = self._classes[extension.containing_type.full_name] |