diff options
Diffstat (limited to 'python/google/protobuf/json_format.py')
-rw-r--r-- | python/google/protobuf/json_format.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/python/google/protobuf/json_format.py b/python/google/protobuf/json_format.py index 8d338d3e..58c94a47 100644 --- a/python/google/protobuf/json_format.py +++ b/python/google/protobuf/json_format.py @@ -396,11 +396,7 @@ def Parse(text, message, ignore_unknown_fields=False): """ if not isinstance(text, six.text_type): text = text.decode('utf-8') try: - if sys.version_info < (2, 7): - # object_pair_hook is not supported before python2.7 - js = json.loads(text) - else: - js = json.loads(text, object_pairs_hook=_DuplicateChecker) + js = json.loads(text, object_pairs_hook=_DuplicateChecker) except ValueError as e: raise ParseError('Failed to load JSON: {0}.'.format(str(e))) return ParseDict(js, message, ignore_unknown_fields) |