diff options
author | Dan O'Reilly <oreilldf@gmail.com> | 2015-08-14 15:26:33 -0400 |
---|---|---|
committer | Dan O'Reilly <oreilldf@gmail.com> | 2015-08-14 15:26:33 -0400 |
commit | fe7d9379df3ce7c951bc0652a451413cff02382a (patch) | |
tree | 9f07e17b2dd4f77c67b126c28123e9945ee9f7f9 /python/google/protobuf/text_format.py | |
parent | 6654e77f1d9d67b92eef5e0066c71ee3c6263817 (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-x | python/google/protobuf/text_format.py | 5 |
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: |