aboutsummaryrefslogtreecommitdiff
path: root/python/google/protobuf/internal/decoder.py
diff options
context:
space:
mode:
authorDan O'Reilly <oreilldf@gmail.com>2015-08-14 15:26:33 -0400
committerDan O'Reilly <oreilldf@gmail.com>2015-08-14 15:26:33 -0400
commitfe7d9379df3ce7c951bc0652a451413cff02382a (patch)
tree9f07e17b2dd4f77c67b126c28123e9945ee9f7f9 /python/google/protobuf/internal/decoder.py
parent6654e77f1d9d67b92eef5e0066c71ee3c6263817 (diff)
downloadprotobuf-fe7d9379df3ce7c951bc0652a451413cff02382a.tar.gz
protobuf-fe7d9379df3ce7c951bc0652a451413cff02382a.tar.bz2
protobuf-fe7d9379df3ce7c951bc0652a451413cff02382a.zip
Fixing some long/int bugs
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
Diffstat (limited to 'python/google/protobuf/internal/decoder.py')
-rwxr-xr-xpython/google/protobuf/internal/decoder.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/python/google/protobuf/internal/decoder.py b/python/google/protobuf/internal/decoder.py
index 130386f2..4fd7a864 100755
--- a/python/google/protobuf/internal/decoder.py
+++ b/python/google/protobuf/internal/decoder.py
@@ -86,6 +86,9 @@ import struct
import six
+if six.PY3:
+ long = int
+
from google.protobuf.internal import encoder
from google.protobuf.internal import wire_format
from google.protobuf import message
@@ -157,8 +160,8 @@ def _SignedVarintDecoder(mask, result_type):
# alternate implementations where the distinction is more significant
# (e.g. the C++ implementation) simpler.
-_DecodeVarint = _VarintDecoder((1 << 64) - 1, int)
-_DecodeSignedVarint = _SignedVarintDecoder((1 << 64) - 1, int)
+_DecodeVarint = _VarintDecoder((1 << 64) - 1, long)
+_DecodeSignedVarint = _SignedVarintDecoder((1 << 64) - 1, long)
# Use these versions for values which must be limited to 32 bits.
_DecodeVarint32 = _VarintDecoder((1 << 32) - 1, int)