Pārlūkot izejas kodu

Add __bool__ as well as __nonzero__ for python3

Jie Luo 8 gadi atpakaļ
vecāks
revīzija
9c012ed07d
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      python/google/protobuf/internal/message_test.py

+ 3 - 0
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())