ソースを参照

Add __bool__ as well as __nonzero__ for python3

Jie Luo 8 年 前
コミット
9c012ed07d
1 ファイル変更3 行追加0 行削除
  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())