Эх сурвалжийг харах

Updated descriptor_pool.py to be compatible with Python 3

In Python 3 the values() method on a dictionary returns a view instead
of a list, so we need to explicitly convert that to a list.
Adam Cozzette 8 жил өмнө
parent
commit
259dd7e842

+ 1 - 1
python/google/protobuf/descriptor_pool.py

@@ -408,7 +408,7 @@ class DescriptorPool(object):
     Returns:
     Returns:
       A list of FieldDescriptor describing the extensions.
       A list of FieldDescriptor describing the extensions.
     """
     """
-    return self._extensions_by_number[message_descriptor].values()
+    return list(self._extensions_by_number[message_descriptor].values())
 
 
   def _ConvertFileProtoToFileDescriptor(self, file_proto):
   def _ConvertFileProtoToFileDescriptor(self, file_proto):
     """Creates a FileDescriptor from a proto or returns a cached copy.
     """Creates a FileDescriptor from a proto or returns a cached copy.