Wat da fuke pytz

This commit is contained in:
Alexandre Aubin 2020-04-02 23:44:15 +02:00 committed by Alexandre Aubin
parent 1dfc4ecfa3
commit 8c7b6c0e5f
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
@ -101,6 +100,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')
@ -22,6 +21,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 (