diff options
Diffstat (limited to 'python/google/protobuf/internal/encoder.py')
-rwxr-xr-x | python/google/protobuf/internal/encoder.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/python/google/protobuf/internal/encoder.py b/python/google/protobuf/internal/encoder.py index eed8c8bd..3ec3b2b1 100755 --- a/python/google/protobuf/internal/encoder.py +++ b/python/google/protobuf/internal/encoder.py @@ -123,11 +123,13 @@ class Encoder(object): def AppendFloatNoTag(self, value): """Appends a floating-point number to our buffer.""" - self._stream.AppendRawBytes(struct.pack('f', value)) + self._stream.AppendRawBytes( + struct.pack(wire_format.FORMAT_FLOAT_LITTLE_ENDIAN, value)) def AppendDoubleNoTag(self, value): """Appends a double-precision floating-point number to our buffer.""" - self._stream.AppendRawBytes(struct.pack('d', value)) + self._stream.AppendRawBytes( + struct.pack(wire_format.FORMAT_DOUBLE_LITTLE_ENDIAN, value)) def AppendBoolNoTag(self, value): """Appends a boolean to our buffer.""" |