From b34b48fdc1736bc21dba6896b3ca29e63f27bb81 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Fri, 11 Jan 2019 00:32:19 -0600 Subject: [PATCH] Fix dateutil import --- resources/lib/helper/utils.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/resources/lib/helper/utils.py b/resources/lib/helper/utils.py index 79522abb..e76e0b38 100644 --- a/resources/lib/helper/utils.py +++ b/resources/lib/helper/utils.py @@ -17,7 +17,6 @@ import xbmcgui import xbmcvfs from . import _ -from libraries.dateutil import tz, parser ################################################################################################# @@ -450,8 +449,10 @@ def convert_to_local(date): ''' Convert the local datetime to local. ''' + from libraries.dateutil import tz, parser + try: - date = convert_str_to_date(date) if type(date) in (unicode, str) else date + date = parser.parse(date) if type(date) in (unicode, str) else date date = date.replace(tzinfo=tz.tzutc()) date = date.astimezone(tz.tzlocal()) @@ -460,9 +461,3 @@ def convert_to_local(date): LOG.error(error) return str(date) - -def convert_str_to_date(date): - - ''' Convert string to date. - ''' - return parser.parse(date)