diff options
author | Jie Luo <anandolee@gmail.com> | 2017-07-24 16:42:23 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-24 16:42:23 -0700 |
commit | 9c012ed07d9bea4ac7012a9e697488ccde00c398 (patch) | |
tree | 2466239a247d79ff159d7f786535cc9c31d4023a /python | |
parent | a484794820e3e83caa7ca7e78270c84b75cde21a (diff) | |
download | protobuf-9c012ed07d9bea4ac7012a9e697488ccde00c398.tar.gz protobuf-9c012ed07d9bea4ac7012a9e697488ccde00c398.tar.bz2 protobuf-9c012ed07d9bea4ac7012a9e697488ccde00c398.zip |
Add __bool__ as well as __nonzero__ for python3
Diffstat (limited to 'python')
-rwxr-xr-x | python/google/protobuf/internal/message_test.py | 3 |
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()) |