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
bba4c4ae
Commit
bba4c4ae
authored
Jul 19, 2017
by
Jie Luo
Committed by
GitHub
Jul 19, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3262 from snnn/master
Make it compatible with python 3.6.1
parents
aa61bb0d
4987ddac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
message.cc
python/google/protobuf/pyext/message.cc
+4
-2
repeated_composite_container.cc
python/google/protobuf/pyext/repeated_composite_container.cc
+2
-1
repeated_scalar_container.cc
python/google/protobuf/pyext/repeated_scalar_container.cc
+5
-2
No files found.
python/google/protobuf/pyext/message.cc
View file @
bba4c4ae
...
...
@@ -1055,13 +1055,15 @@ int InternalDeleteRepeatedField(
if
(
PySlice_Check
(
slice
))
{
from
=
to
=
step
=
slice_length
=
0
;
PySlice_GetIndicesEx
(
#if PY_MAJOR_VERSION < 3
PySlice_GetIndicesEx
(
reinterpret_cast
<
PySliceObject
*>
(
slice
),
length
,
&
from
,
&
to
,
&
step
,
&
slice_length
);
#else
PySlice_GetIndicesEx
(
slice
,
#endif
length
,
&
from
,
&
to
,
&
step
,
&
slice_length
);
#endif
if
(
from
<
to
)
{
min
=
from
;
max
=
to
-
1
;
...
...
python/google/protobuf/pyext/repeated_composite_container.cc
View file @
bba4c4ae
...
...
@@ -266,10 +266,11 @@ int AssignSubscript(RepeatedCompositeContainer* self,
if
(
PySlice_Check
(
slice
))
{
#if PY_MAJOR_VERSION >= 3
if
(
PySlice_GetIndicesEx
(
slice
,
length
,
&
from
,
&
to
,
&
step
,
&
slicelength
)
==
-
1
)
{
#else
if
(
PySlice_GetIndicesEx
(
reinterpret_cast
<
PySliceObject
*>
(
slice
),
#endif
length
,
&
from
,
&
to
,
&
step
,
&
slicelength
)
==
-
1
)
{
#endif
return
-
1
;
}
return
PySequence_DelSlice
(
self
->
child_messages
,
from
,
to
);
...
...
python/google/protobuf/pyext/repeated_scalar_container.cc
View file @
bba4c4ae
...
...
@@ -305,10 +305,12 @@ static PyObject* Subscript(RepeatedScalarContainer* self, PyObject* slice) {
length
=
Len
(
self
);
#if PY_MAJOR_VERSION >= 3
if
(
PySlice_GetIndicesEx
(
slice
,
length
,
&
from
,
&
to
,
&
step
,
&
slicelength
)
==
-
1
)
{
#else
if
(
PySlice_GetIndicesEx
(
reinterpret_cast
<
PySliceObject
*>
(
slice
),
#endif
length
,
&
from
,
&
to
,
&
step
,
&
slicelength
)
==
-
1
)
{
#endif
return
NULL
;
}
return_list
=
true
;
...
...
@@ -458,10 +460,11 @@ static int AssSubscript(RepeatedScalarContainer* self,
length
=
reflection
->
FieldSize
(
*
message
,
field_descriptor
);
#if PY_MAJOR_VERSION >= 3
if
(
PySlice_GetIndicesEx
(
slice
,
length
,
&
from
,
&
to
,
&
step
,
&
slicelength
)
==
-
1
)
{
#else
if
(
PySlice_GetIndicesEx
(
reinterpret_cast
<
PySliceObject
*>
(
slice
),
#endif
length
,
&
from
,
&
to
,
&
step
,
&
slicelength
)
==
-
1
)
{
#endif
return
-
1
;
}
create_list
=
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