summaryrefslogtreecommitdiff
path: root/msgpack
diff options
context:
space:
mode:
authorPeter Fischer <yanlend@users.noreply.github.com>2020-07-24 09:29:15 +0200
committerGitHub <noreply@github.com>2020-07-24 16:29:15 +0900
commit772c830841a276adb392dd449809764b2826b1f8 (patch)
tree490478f024f9d4642d337bcca816d3af6e28f30b /msgpack
parent5614dd5a898772faa2dfe89bd9f6a5c90c5fafe5 (diff)
downloadmsgpack-python-772c830841a276adb392dd449809764b2826b1f8.tar.gz
Synchronize handling of datetime in Packer implementations (#434)
The handling of datetime is different in the cython and Python implementations. In contrast to the docs, timezone is not required in the Python implementation.
Diffstat (limited to 'msgpack')
-rw-r--r--msgpack/fallback.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/msgpack/fallback.py b/msgpack/fallback.py
index 1e0bbe9..9739d53 100644
--- a/msgpack/fallback.py
+++ b/msgpack/fallback.py
@@ -921,7 +921,7 @@ class Packer(object):
len(obj), dict_iteritems(obj), nest_limit - 1
)
- if self._datetime and check(obj, _DateTime):
+ if self._datetime and check(obj, _DateTime) and obj.tzinfo is not None:
obj = Timestamp.from_datetime(obj)
default_used = 1
continue