Skip to content

Commit 9c012ed

Browse files
authored
Add __bool__ as well as __nonzero__ for python3
1 parent a484794 commit 9c012ed

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python/google/protobuf/internal/message_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ class BadArg(object):
166166
def __nonzero__(self):
167167
raise BadArgError()
168168

169+
def __bool__(self):
170+
raise BadArgError()
171+
169172
with self.assertRaises(BadArgError):
170173
golden_message.SerializeToString(deterministic=BadArg())
171174

0 commit comments

Comments
 (0)