aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jie Luo <anandolee@gmail.com>2017-07-24 16:42:23 -0700
committerGravatar GitHub <noreply@github.com>2017-07-24 16:42:23 -0700
commit9c012ed07d9bea4ac7012a9e697488ccde00c398 (patch)
tree2466239a247d79ff159d7f786535cc9c31d4023a
parenta484794820e3e83caa7ca7e78270c84b75cde21a (diff)
Add __bool__ as well as __nonzero__ for python3
-rwxr-xr-xpython/google/protobuf/internal/message_test.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/google/protobuf/internal/message_test.py b/python/google/protobuf/internal/message_test.py
index 6f60586a..29a515b2 100755
--- a/python/google/protobuf/internal/message_test.py
+++ b/python/google/protobuf/internal/message_test.py
@@ -166,6 +166,9 @@ class MessageTest(BaseTestCase):
def __nonzero__(self):
raise BadArgError()
+ def __bool__(self):
+ raise BadArgError()
+
with self.assertRaises(BadArgError):
golden_message.SerializeToString(deterministic=BadArg())