Explorar el Código

Events: Fixes Django timezone problems. Closes #1802

Ask Solem hace 11 años
padre
commit
2b97ac7c67
Se han modificado 1 ficheros con 4 adiciones y 7 borrados
  1. 4 7
      celery/utils/timeutils.py

+ 4 - 7
celery/utils/timeutils.py

@@ -50,9 +50,6 @@ ZERO = timedelta(0)
 
 _local_timezone = None
 
-__timezone__ = -_time.timezone
-__altzone__ = -_time.altzone
-
 
 class LocalTimezone(tzinfo):
     """Local time implementation taken from Python's docs.
@@ -334,10 +331,10 @@ class ffwd(object):
         }, **extra)
 
 
-def utcoffset():
-    if _time.daylight:
-        return __altzone__ // 3600
-    return __timezone__ // 3600
+def utcoffset(time=_time):
+    if time.daylight:
+        return time.altzone // 3600
+    return time.timezone // 3600
 
 
 def adjust_timestamp(ts, offset, here=utcoffset):