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
411968d0
Commit
411968d0
authored
Sep 23, 2016
by
Bo Yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix python cpp.
parent
37c3d05f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
15 deletions
+13
-15
python_message.py
python/google/protobuf/internal/python_message.py
+4
-1
testing_refleaks.py
python/google/protobuf/internal/testing_refleaks.py
+8
-4
descriptor_pool.h
python/google/protobuf/pyext/descriptor_pool.h
+1
-1
message.cc
python/google/protobuf/pyext/message.cc
+0
-7
tests.sh
tests.sh
+0
-2
No files found.
python/google/protobuf/internal/python_message.py
View file @
411968d0
...
...
@@ -63,7 +63,10 @@ except ImportError:
# nothing like hermetic Python. This means lesser control on the system and
# the six.moves package may be missing (is missing on 20150321 on gMac). Be
# extra conservative and try to load the old replacement if it fails.
import
copy_reg
as
copyreg
try
:
import
copy_reg
as
copyreg
#PY26
except
ImportError
:
import
copyreg
# We use "as" to avoid name collisions with variables.
from
google.protobuf.internal
import
containers
...
...
python/google/protobuf/internal/testing_refleaks.py
View file @
411968d0
...
...
@@ -38,10 +38,14 @@ If sys.gettotalrefcount() is not available (because Python was built without
the Py_DEBUG option), then this module is a no-op and tests will run normally.
"""
import
copy_reg
import
gc
import
sys
try
:
import
copy_reg
as
copyreg
#PY26
except
ImportError
:
import
copyreg
try
:
import
unittest2
as
unittest
#PY26
except
ImportError
:
...
...
@@ -74,7 +78,7 @@ class ReferenceLeakCheckerTestCase(unittest.TestCase):
# python_message.py registers all Message classes to some pickle global
# registry, which makes the classes immortal.
# We save a copy of this registry, and reset it before we could references.
self
.
_saved_pickle_registry
=
copy
_
reg
.
dispatch_table
.
copy
()
self
.
_saved_pickle_registry
=
copyreg
.
dispatch_table
.
copy
()
# Run the test twice, to warm up the instance attributes.
super
(
ReferenceLeakCheckerTestCase
,
self
)
.
run
(
result
=
result
)
...
...
@@ -97,8 +101,8 @@ class ReferenceLeakCheckerTestCase(unittest.TestCase):
result
.
addError
(
self
,
sys
.
exc_info
())
def
_getRefcounts
(
self
):
copy
_
reg
.
dispatch_table
.
clear
()
copy
_
reg
.
dispatch_table
.
update
(
self
.
_saved_pickle_registry
)
copyreg
.
dispatch_table
.
clear
()
copyreg
.
dispatch_table
.
update
(
self
.
_saved_pickle_registry
)
# It is sometimes necessary to gc.collect() multiple times, to ensure
# that all objects can be collected.
gc
.
collect
()
...
...
python/google/protobuf/pyext/descriptor_pool.h
View file @
411968d0
...
...
@@ -40,7 +40,7 @@ namespace google {
namespace
protobuf
{
namespace
python
{
class
PyMessageFactory
;
struct
PyMessageFactory
;
// The (meta) type of all Messages classes.
struct
CMessageClass
;
...
...
python/google/protobuf/pyext/message.cc
View file @
411968d0
...
...
@@ -2831,13 +2831,6 @@ static Message* MutableCProtoInsidePyProtoImpl(PyObject* msg) {
return
cmsg
->
message
;
}
static
const
char
module_docstring
[]
=
"python-proto2 is a module that can be used to enhance proto2 Python API
\n
"
"performance.
\n
"
"
\n
"
"It provides access to the protocol buffers C++ reflection API that
\n
"
"implements the basic protocol buffer functions."
;
void
InitGlobals
()
{
// TODO(gps): Check all return values in this function for NULL and propagate
// the error (MemoryError) on up to result in an import failure. These should
...
...
tests.sh
View file @
411968d0
...
...
@@ -296,8 +296,6 @@ build_python() {
build_python_cpp
()
{
internal_build_cpp
internal_install_python_deps
export
LD_LIBRARY_PATH
=
../src/.libs
# for Linux
export
DYLD_LIBRARY_PATH
=
../src/.libs
# for OS X
cd
python
# Only test Python 2.6/3.x on Linux
if
[
$(
uname
-s
)
==
"Linux"
]
;
then
...
...
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