diff options
author | jieluo@google.com <jieluo@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2014-08-25 20:17:53 +0000 |
---|---|---|
committer | jieluo@google.com <jieluo@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2014-08-25 20:17:53 +0000 |
commit | 1eba9d9c7424235b1a6dcd866fcd06d12e08a7f3 (patch) | |
tree | b2a894794db1f6147214e356c20f754e270f4e7f /python/google | |
parent | 786379af4766fa7ec22b51862ba6e84156b1f9cb (diff) | |
download | protobuf-1eba9d9c7424235b1a6dcd866fcd06d12e08a7f3.tar.gz protobuf-1eba9d9c7424235b1a6dcd866fcd06d12e08a7f3.tar.bz2 protobuf-1eba9d9c7424235b1a6dcd866fcd06d12e08a7f3.zip |
merge tags/2.6.0 into trunk
Diffstat (limited to 'python/google')
-rwxr-xr-x | python/google/protobuf/internal/reflection_test.py | 23 | ||||
-rw-r--r-- | python/google/protobuf/pyext/__init__.py | 0 |
2 files changed, 1 insertions, 22 deletions
diff --git a/python/google/protobuf/internal/reflection_test.py b/python/google/protobuf/internal/reflection_test.py index 587246a7..b3c414c7 100755 --- a/python/google/protobuf/internal/reflection_test.py +++ b/python/google/protobuf/internal/reflection_test.py @@ -41,7 +41,6 @@ import copy import gc import operator import struct -import sys from google.apputils import basetest from google.protobuf import unittest_import_pb2 @@ -1557,20 +1556,7 @@ class ReflectionTest(basetest.TestCase): def assertNotInitialized(self, proto): self.assertFalse(proto.IsInitialized()) - try: - proto.SerializeToString() - except message.EncodeError: - return - except: - # C++ implementation in opensource do not consider the catched - # exception google.protobuf.message.EncodeError same as - # message.EncodeError. Add an additional catch to deal with it. - if api_implementation.Type() == 'python': - raise self.failureException('message.EncodeError not raised') - self.assertEqual('<class \'google.protobuf.message.EncodeError\'>', - str(sys.exc_info()[0])) - else: - raise self.failureException('message.EncodeError not raised') + self.assertRaises(message.EncodeError, proto.SerializeToString) # "Partial" serialization doesn't care if message is uninitialized. proto.SerializePartialToString() @@ -2500,13 +2486,6 @@ class SerializationTest(basetest.TestCase): # Check if the exception message is the right one. self.assertEqual(exception, str(ex)) return - except: - # C++ implementation in opensource do not consider the catched - # exception google.protobuf.message.EncodeError same as - # message.EncodeError. Add an additional catch to deal with it. - if api_implementation.Type() == 'python': - raise self.failureException('%s not raised' % str(exc_class)) - self.assertEqual(exception, str(sys.exc_info()[1])) else: raise self.failureException('%s not raised' % str(exc_class)) diff --git a/python/google/protobuf/pyext/__init__.py b/python/google/protobuf/pyext/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/python/google/protobuf/pyext/__init__.py |