Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
595231dd
Commit
595231dd
authored
Jun 25, 2018
by
Yuchen Xie
Committed by
Jie Luo
Jun 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update minimal Python version to 2.7 (#4207)
parent
d65d5821
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
13 deletions
+5
-13
README.md
python/README.md
+1
-1
json_format_test.py
python/google/protobuf/internal/json_format_test.py
+0
-3
json_format.py
python/google/protobuf/json_format.py
+1
-5
setup.py
python/setup.py
+3
-4
No files found.
python/README.md
View file @
595231dd
...
...
@@ -30,7 +30,7 @@ join the Protocol Buffers discussion list and let us know!
Installation
============
1) Make sure you have Python 2.
6
or newer. If in doubt, run:
1) Make sure you have Python 2.
7
or newer. If in doubt, run:
$ python -V
...
...
python/google/protobuf/internal/json_format_test.py
View file @
595231dd
...
...
@@ -791,9 +791,6 @@ class JsonFormatTest(JsonFormatBase):
json_format
.
Parse
(
text
,
parsed_message
,
ignore_unknown_fields
=
True
)
def
testDuplicateField
(
self
):
# Duplicate key check is not supported for python2.6
if
sys
.
version_info
<
(
2
,
7
):
return
self
.
CheckError
(
'{"int32Value": 1,
\n
"int32Value":2}'
,
'Failed to load JSON: duplicate key int32Value.'
)
...
...
python/google/protobuf/json_format.py
View file @
595231dd
...
...
@@ -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
)
...
...
python/setup.py
View file @
595231dd
...
...
@@ -149,10 +149,9 @@ class build_py(_build_py):
class
test_conformance
(
_build_py
):
target
=
'test_python'
def
run
(
self
):
if
sys
.
version_info
>=
(
2
,
7
):
# Python 2.6 dodges these extra failures.
os
.
environ
[
"CONFORMANCE_PYTHON_EXTRA_FAILURES"
]
=
(
"--failure_list failure_list_python-post26.txt"
)
# Python 2.6 dodges these extra failures.
os
.
environ
[
"CONFORMANCE_PYTHON_EXTRA_FAILURES"
]
=
(
"--failure_list failure_list_python-post26.txt"
)
cmd
=
'cd ../conformance && make
%
s'
%
(
test_conformance
.
target
)
status
=
subprocess
.
check_call
(
cmd
,
shell
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment