Skip to content

Commit d244269

Browse files
committed
Fixes from mypy
1 parent 0ab8574 commit d244269

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

aredis_om/model/encoders.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,18 @@ def datetime_to_timestamp(t: datetime.datetime) -> int:
5050
def time_to_timestamp(t: datetime.time) -> int:
5151
# TODO: Find better / more correct approach!!!!!!!!!!!
5252
offset = t.utcoffset()
53-
offset = math.floor(offset.total_seconds() * 1000) + offset.microseconds // 1000
53+
offset_ms = (
54+
math.floor(offset.total_seconds() * 1000) + offset.microseconds // 1000
55+
if offset is not None
56+
else 0
57+
)
5458
return (
5559
t.hour * 3600 * 1000
5660
+ t.minute * 60 * 1000
5761
+ t.second * 1000
5862
+ t.microsecond // 1000
5963
# TODO: Find better / more correct approach!!!!!!!!!!!
60-
- offset
64+
- offset_ms
6165
)
6266

6367

0 commit comments

Comments
 (0)