diff src/tools/utils.py @ 2477:cae326e962c3

tool (utils): import directly parser from dateutil
author Goffi <goffi@goffi.org>
date Sun, 21 Jan 2018 13:04:16 +0100
parents 8084066ac95b
children 0046283a285d
line wrap: on
line diff
--- a/src/tools/utils.py	Fri Jan 19 17:41:10 2018 +0100
+++ b/src/tools/utils.py	Sun Jan 21 13:04:16 2018 +0100
@@ -24,7 +24,7 @@
 from sat.core.log import getLogger
 log = getLogger(__name__)
 import datetime
-import dateutil
+from dateutil import parser as dateutil_parser
 import calendar
 import time
 import sys
@@ -89,7 +89,7 @@
     @param value(unicode): date to parse, in any format supported by dateutil.parser
     @return (int): timestamp
     """
-    return calendar.timegm(dateutil.parser.parse(unicode(value)).utctimetuple())
+    return calendar.timegm(dateutil_parser.parse(unicode(value)).utctimetuple())
 
 def generatePassword(vocabulary=None, size=20):
     """Generate a password with random characters.