Add __bool__ as well as __nonzero__ for python3

pull/3412/head
Jie Luo 8 years ago committed by GitHub
parent a484794820
commit 9c012ed07d
  1. 3
      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())

Loading…
Cancel
Save