aboutsummaryrefslogtreecommitdiffhomepage
path: root/python/google/protobuf/text_format.py
diff options
context:
space:
mode:
authorGravatar Dan O'Reilly <oreilldf@gmail.com>2015-08-14 15:26:33 -0400
committerGravatar Dan O'Reilly <oreilldf@gmail.com>2015-08-14 15:26:33 -0400
commitfe7d9379df3ce7c951bc0652a451413cff02382a (patch)
tree9f07e17b2dd4f77c67b126c28123e9945ee9f7f9 /python/google/protobuf/text_format.py
parent6654e77f1d9d67b92eef5e0066c71ee3c6263817 (diff)
Fixing some long/int bugs
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
Diffstat (limited to 'python/google/protobuf/text_format.py')
-rwxr-xr-xpython/google/protobuf/text_format.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/google/protobuf/text_format.py b/python/google/protobuf/text_format.py
index 6dd7f551..d4c4610f 100755
--- a/python/google/protobuf/text_format.py
+++ b/python/google/protobuf/text_format.py
@@ -39,6 +39,9 @@ import re
import six
+if six.PY3:
+ long = int
+
from google.protobuf.internal import type_checkers
from google.protobuf import descriptor
from google.protobuf import text_encoding
@@ -813,7 +816,7 @@ def ParseInteger(text, is_signed=False, is_long=False):
# alternate implementations where the distinction is more significant
# (e.g. the C++ implementation) simpler.
if is_long:
- result = int(text, 0)
+ result = long(text, 0)
else:
result = int(text, 0)
except ValueError: