summaryrefslogtreecommitdiff
path: root/msgpack
diff options
context:
space:
mode:
Diffstat (limited to 'msgpack')
-rw-r--r--msgpack/_packer.pyx9
1 files changed, 4 insertions, 5 deletions
diff --git a/msgpack/_packer.pyx b/msgpack/_packer.pyx
index 2a768b0..1426439 100644
--- a/msgpack/_packer.pyx
+++ b/msgpack/_packer.pyx
@@ -153,11 +153,10 @@ cdef class Packer(object):
while True:
if o is None:
ret = msgpack_pack_nil(&self.pk)
- elif PyBool_Check(o) if strict_types else isinstance(o, bool):
- if o:
- ret = msgpack_pack_true(&self.pk)
- else:
- ret = msgpack_pack_false(&self.pk)
+ elif o is True:
+ ret = msgpack_pack_true(&self.pk)
+ elif o is False:
+ ret = msgpack_pack_false(&self.pk)
elif PyLong_CheckExact(o) if strict_types else PyLong_Check(o):
# PyInt_Check(long) is True for Python 3.
# So we should test long before int.