aboutsummaryrefslogtreecommitdiffhomepage
path: root/python/google/protobuf/internal/output_stream.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/google/protobuf/internal/output_stream.py')
-rwxr-xr-xpython/google/protobuf/internal/output_stream.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/python/google/protobuf/internal/output_stream.py b/python/google/protobuf/internal/output_stream.py
index 767e9725..ccb91225 100755
--- a/python/google/protobuf/internal/output_stream.py
+++ b/python/google/protobuf/internal/output_stream.py
@@ -101,11 +101,10 @@ class OutputStream(object):
while True:
bits = unsigned_value & 0x7f
unsigned_value >>= 7
- if unsigned_value:
- bits |= 0x80
- self._buffer.append(bits)
if not unsigned_value:
+ self._buffer.append(bits)
break
+ self._buffer.append(0x80|bits)
def ToString(self):
"""Returns a string containing the bytes in our internal buffer."""