summaryrefslogtreecommitdiff
path: root/msgpack/_packer.pyx
diff options
context:
space:
mode:
Diffstat (limited to 'msgpack/_packer.pyx')
-rw-r--r--msgpack/_packer.pyx2
1 files changed, 2 insertions, 0 deletions
diff --git a/msgpack/_packer.pyx b/msgpack/_packer.pyx
index e6cd2c7..396da0c 100644
--- a/msgpack/_packer.pyx
+++ b/msgpack/_packer.pyx
@@ -285,6 +285,8 @@ cdef class Packer(object):
o = self._default(o)
default_used = 1
continue
+ elif self.datetime and PyDateTime_CheckExact(o):
+ PyErr_Format(ValueError, b"can not serialize '%.200s' object where tzinfo=None", Py_TYPE(o).tp_name)
else:
PyErr_Format(TypeError, b"can not serialize '%.200s' object", Py_TYPE(o).tp_name)
return ret