From 1c834af8df9a0fe887c20ac3f0b1db8e9abd3925 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Thu, 21 Aug 2008 00:43:15 -0700 Subject: [PATCH] Okay, just doing the datetime precision hack unconditionally on Windows. --- model/Persistent.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/model/Persistent.py b/model/Persistent.py index e982b42..b58e3aa 100644 --- a/model/Persistent.py +++ b/model/Persistent.py @@ -1,3 +1,4 @@ +import sys import time from datetime import datetime from pytz import utc @@ -74,9 +75,9 @@ class Persistent( object ): def update_revision( self ): revision = datetime.now( tz = utc ) - # if the revision didn't change, then we must be using a low-precision timer on a platform like - # Windows. so, replace the microseconds with a value from a higher-precision timer - if revision == self.__revision: + # as a work around for the low-precision timer on Windows, replace the microseconds with a value + # from a higher-precision timer + if sys.platform.startswith( "win" ): MICROSECONDS = 1000000 revision = revision.replace( microsecond = int( time.clock() * MICROSECONDS ) % MICROSECONDS )