Wat da fuke pytz

This commit is contained in:
Alexandre Aubin 2020-04-02 23:44:15 +02:00
parent 78f37782ae
commit 3a3ce804d6
2 changed files with 5 additions and 2 deletions

View file

@ -7,7 +7,6 @@ import locale
import logging
from argparse import SUPPRESS
from collections import OrderedDict
import pytz
from datetime import date, datetime
import argcomplete
@ -103,6 +102,8 @@ def pretty_date(_date):
Argument:
- date -- The date or datetime to display
"""
import pytz # Lazy loading, this takes like 3+ sec on a RPi2 ?!
# Deduce system timezone
nowutc = datetime.now(tz=pytz.utc)
nowtz = datetime.now()

View file

@ -1,7 +1,6 @@
import logging
from json.encoder import JSONEncoder
import datetime
import pytz
logger = logging.getLogger("moulinette.utils.serialize")
@ -23,6 +22,9 @@ class JSONExtendedEncoder(JSONEncoder):
"""
def default(self, o):
import pytz # Lazy loading, this takes like 3+ sec on a RPi2 ?!
"""Return a serializable object"""
# Convert compatible containers into list
if isinstance(o, set) or (hasattr(o, "__iter__") and hasattr(o, "next")):