aboutsummaryrefslogtreecommitdiffhomepage
path: root/python
diff options
context:
space:
mode:
authorGravatar Jisi Liu <liujisi@google.com>2015-03-03 17:51:05 -0800
committerGravatar Jisi Liu <liujisi@google.com>2015-03-03 17:51:05 -0800
commited3c8a11f98995c6bf210566ea10659cb3f3abff (patch)
tree8ead682439a320615d8352af030dc8635f22fab7 /python
parentc6170a96e3973c61fd062bb65ffd4e7c758b6cf0 (diff)
parent0b3cfc7981fed468f7dec27eb7be1739d17cc171 (diff)
Merge pull request #225 from google/post-alpha2-integrate
Post alpha2 integrate from google internal for C++ and Java
Diffstat (limited to 'python')
-rwxr-xr-xpython/google/protobuf/internal/message_test.py3
-rwxr-xr-xpython/google/protobuf/internal/text_format_test.py2
-rw-r--r--python/google/protobuf/pyext/descriptor.cc15
-rw-r--r--python/google/protobuf/pyext/message.cc5
-rw-r--r--python/google/protobuf/pyext/repeated_composite_container.cc7
-rw-r--r--python/google/protobuf/pyext/repeated_scalar_container.cc5
6 files changed, 22 insertions, 15 deletions
diff --git a/python/google/protobuf/internal/message_test.py b/python/google/protobuf/internal/message_test.py
index 4d4de510..ed1298af 100755
--- a/python/google/protobuf/internal/message_test.py
+++ b/python/google/protobuf/internal/message_test.py
@@ -51,10 +51,10 @@ import sys
import unittest
from google.apputils import basetest
+from google.protobuf.internal import _parameterized
from google.protobuf import unittest_pb2
from google.protobuf import unittest_proto3_arena_pb2
from google.protobuf.internal import api_implementation
-from google.protobuf.internal import _parameterized
from google.protobuf.internal import test_util
from google.protobuf import message
@@ -982,6 +982,7 @@ class Proto2Test(basetest.TestCase):
# This is still an incomplete proto - so serializing should fail
self.assertRaises(message.EncodeError, unpickled_message.SerializeToString)
+
# TODO(haberman): this isn't really a proto2-specific test except that this
# message has a required field in it. Should probably be factored out so
# that we can test the other parts with proto3.
diff --git a/python/google/protobuf/internal/text_format_test.py b/python/google/protobuf/internal/text_format_test.py
index b307620d..7d5813fb 100755
--- a/python/google/protobuf/internal/text_format_test.py
+++ b/python/google/protobuf/internal/text_format_test.py
@@ -37,12 +37,12 @@ __author__ = 'kenton@google.com (Kenton Varda)'
import re
from google.apputils import basetest
+from google.protobuf.internal import _parameterized
from google.protobuf import unittest_mset_pb2
from google.protobuf import unittest_pb2
from google.protobuf import unittest_proto3_arena_pb2
from google.protobuf.internal import api_implementation
-from google.protobuf.internal import _parameterized
from google.protobuf.internal import test_util
from google.protobuf import text_format
diff --git a/python/google/protobuf/pyext/descriptor.cc b/python/google/protobuf/pyext/descriptor.cc
index 6890cd04..e77d0bb9 100644
--- a/python/google/protobuf/pyext/descriptor.cc
+++ b/python/google/protobuf/pyext/descriptor.cc
@@ -298,8 +298,9 @@ static PyGetSetDef Getters[] = {
PyTypeObject PyBaseDescriptor_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "google.protobuf.internal."
- "_message.DescriptorBase", // tp_name
+ // Keep the fully qualified _message symbol in a line for opensource.
+ "google.protobuf.internal._message."
+ "DescriptorBase", // tp_name
sizeof(PyBaseDescriptor), // tp_basicsize
0, // tp_itemsize
(destructor)Dealloc, // tp_dealloc
@@ -551,8 +552,9 @@ static PyMethodDef Methods[] = {
PyTypeObject PyMessageDescriptor_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
- C("google.protobuf.internal."
- "_message.MessageDescriptor"), // tp_name
+ // Keep the fully qualified _message symbol in a line for opensource.
+ C("google.protobuf.internal._message."
+ "MessageDescriptor"), // tp_name
sizeof(PyBaseDescriptor), // tp_basicsize
0, // tp_itemsize
0, // tp_dealloc
@@ -979,8 +981,9 @@ static PyGetSetDef Getters[] = {
PyTypeObject PyEnumDescriptor_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
- C("google.protobuf.internal."
- "_message.EnumDescriptor"), // tp_name
+ // Keep the fully qualified _message symbol in a line for opensource.
+ C("google.protobuf.internal._message."
+ "EnumDescriptor"), // tp_name
sizeof(PyBaseDescriptor), // tp_basicsize
0, // tp_itemsize
0, // tp_dealloc
diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc
index c48f94c3..a2b357b2 100644
--- a/python/google/protobuf/pyext/message.cc
+++ b/python/google/protobuf/pyext/message.cc
@@ -2304,8 +2304,9 @@ int SetAttr(CMessage* self, PyObject* name, PyObject* value) {
PyTypeObject CMessage_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "google.protobuf."
- "pyext._message.CMessage", // tp_name
+ // Keep the fully qualified _message symbol in a line for opensource.
+ "google.protobuf.pyext._message."
+ "CMessage", // tp_name
sizeof(CMessage), // tp_basicsize
0, // tp_itemsize
(destructor)cmessage::Dealloc, // tp_dealloc
diff --git a/python/google/protobuf/pyext/repeated_composite_container.cc b/python/google/protobuf/pyext/repeated_composite_container.cc
index abc859d7..0fe98e73 100644
--- a/python/google/protobuf/pyext/repeated_composite_container.cc
+++ b/python/google/protobuf/pyext/repeated_composite_container.cc
@@ -732,9 +732,10 @@ static PyMethodDef Methods[] = {
PyTypeObject RepeatedCompositeContainer_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "google.protobuf.pyext."
- "_message.RepeatedCompositeContainer", // tp_name
- sizeof(RepeatedCompositeContainer), // tp_basicsize
+ // Keep the fully qualified _message symbol in a line for opensource.
+ "google.protobuf.pyext._message."
+ "RepeatedCompositeContainer", // tp_name
+ sizeof(RepeatedCompositeContainer), // tp_basicsize
0, // tp_itemsize
(destructor)repeated_composite_container::Dealloc, // tp_dealloc
0, // tp_print
diff --git a/python/google/protobuf/pyext/repeated_scalar_container.cc b/python/google/protobuf/pyext/repeated_scalar_container.cc
index 17474598..110a4c85 100644
--- a/python/google/protobuf/pyext/repeated_scalar_container.cc
+++ b/python/google/protobuf/pyext/repeated_scalar_container.cc
@@ -769,8 +769,9 @@ static PyMethodDef Methods[] = {
PyTypeObject RepeatedScalarContainer_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
- "google.protobuf."
- "pyext._message.RepeatedScalarContainer", // tp_name
+ // Keep the fully qualified _message symbol in a line for opensource.
+ "google.protobuf.pyext._message."
+ "RepeatedScalarContainer", // tp_name
sizeof(RepeatedScalarContainer), // tp_basicsize
0, // tp_itemsize
(destructor)repeated_scalar_container::Dealloc, // tp_dealloc