Skip to content

Commit d1d3df0

Browse files
authored
Replace deprecated datetime.utcfromtimestamp() with timezone-aware date (#183)
1 parent db0de6e commit d1d3df0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scrapinghub/hubstorage/serialization.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
import six
2-
from json import dumps, loads
31
from datetime import datetime
2+
from json import dumps, loads
43

5-
EPOCH = datetime.utcfromtimestamp(0)
4+
import six
5+
6+
EPOCH = datetime(1970, 1, 1, 0, 0)
67
ADAYINSECONDS = 24 * 3600
78

89

910
try:
1011
from msgpack import Unpacker
12+
1113
MSGPACK_AVAILABLE = True
1214
except ImportError:
1315
MSGPACK_AVAILABLE = False

0 commit comments

Comments
 (0)