Browse Source

Okay, just doing the datetime precision hack unconditionally on Windows.

Dan Helfman 10 years ago
parent
commit
1c834af8df
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      model/Persistent.py

+ 4
- 3
model/Persistent.py View File

@@ -1,3 +1,4 @@
1
+import sys
1 2
 import time
2 3
 from datetime import datetime
3 4
 from pytz import utc
@@ -74,9 +75,9 @@ class Persistent( object ):
74 75
   def update_revision( self ):
75 76
     revision = datetime.now( tz = utc )
76 77
 
77
-    # if the revision didn't change, then we must be using a low-precision timer on a platform like
78
-    # Windows. so, replace the microseconds with a value from a higher-precision timer
79
-    if revision == self.__revision:
78
+    # as a work around for the low-precision timer on Windows, replace the microseconds with a value
79
+    # from a higher-precision timer
80
+    if sys.platform.startswith( "win" ):
80 81
       MICROSECONDS = 1000000
81 82
       revision = revision.replace( microsecond = int( time.clock() * MICROSECONDS ) % MICROSECONDS )
82 83
 

Loading…
Cancel
Save