We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d10f12d commit 5fd6119Copy full SHA for 5fd6119
msgpack/_packer.pyx
@@ -153,11 +153,10 @@ cdef class Packer(object):
153
while True:
154
if o is None:
155
ret = msgpack_pack_nil(&self.pk)
156
- elif PyBool_Check(o) if strict_types else isinstance(o, bool):
157
- if o:
158
- ret = msgpack_pack_true(&self.pk)
159
- else:
160
- 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)
161
elif PyLong_CheckExact(o) if strict_types else PyLong_Check(o):
162
# PyInt_Check(long) is True for Python 3.
163
# So we should test long before int.
0 commit comments