summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2019-04-03 23:16:37 +0100
committerMaxime “pep” Buquet <pep@bouah.net>2019-04-03 23:16:37 +0100
commit0042108a67019e6e65b95519643bb965423abc67 (patch)
treea01274fc9b9dc3b9ac02e77c876bd3274d56d351
parent2dda6b80d46e2d07175348777db69f58b7735ac3 (diff)
downloadslixmpp-0042108a67019e6e65b95519643bb965423abc67.tar.gz
slixmpp-0042108a67019e6e65b95519643bb965423abc67.tar.bz2
slixmpp-0042108a67019e6e65b95519643bb965423abc67.tar.xz
slixmpp-0042108a67019e6e65b95519643bb965423abc67.zip
poezio/poezio#3472: Ensure tz is correctly set when offset is an int
Thanks lovetox! Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--slixmpp/plugins/xep_0082.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/slixmpp/plugins/xep_0082.py b/slixmpp/plugins/xep_0082.py
index 24436622..a0b22a2f 100644
--- a/slixmpp/plugins/xep_0082.py
+++ b/slixmpp/plugins/xep_0082.py
@@ -130,7 +130,7 @@ def time(hour=None, min=None, sec=None, micro=None, offset=None, obj=False):
sec = now.second
if micro is None:
micro = now.microsecond
- if offset is None:
+ if offset in (None, 0):
offset = tzutc()
elif not isinstance(offset, dt.tzinfo):
offset = tzoffset(None, offset)
@@ -177,7 +177,7 @@ def datetime(year=None, month=None, day=None, hour=None,
sec = now.second
if micro is None:
micro = now.microsecond
- if offset is None:
+ if offset in (None, 0):
offset = tzutc()
elif not isinstance(offset, dt.tzinfo):
offset = tzoffset(None, offset)