From fe7d9379df3ce7c951bc0652a451413cff02382a Mon Sep 17 00:00:00 2001 From: Dan O'Reilly Date: Fri, 14 Aug 2015 15:26:33 -0400 Subject: Fixing some long/int bugs Signed-off-by: Dan O'Reilly --- python/google/protobuf/text_format.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'python/google/protobuf/text_format.py') 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: -- cgit v1.2.3