[Python-checkins] r75421 - python/trunk/Lib/uuid.py

antoine.pitrou python-checkins at python.org
Wed Oct 14 21:09:49 CEST 2009


Author: antoine.pitrou
Date: Wed Oct 14 21:09:48 2009
New Revision: 75421

Log:
Fix py3k warnings in the uuid module



Modified:
   python/trunk/Lib/uuid.py

Modified: python/trunk/Lib/uuid.py
==============================================================================
--- python/trunk/Lib/uuid.py	(original)
+++ python/trunk/Lib/uuid.py	Wed Oct 14 21:09:48 2009
@@ -489,8 +489,8 @@
     nanoseconds = int(time.time() * 1e9)
     # 0x01b21dd213814000 is the number of 100-ns intervals between the
     # UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00.
-    timestamp = int(nanoseconds/100) + 0x01b21dd213814000L
-    if timestamp <= _last_timestamp:
+    timestamp = int(nanoseconds//100) + 0x01b21dd213814000L
+    if _last_timestamp is not None and timestamp <= _last_timestamp:
         timestamp = _last_timestamp + 1
     _last_timestamp = timestamp
     if clock_seq is None:


More information about the Python-checkins mailing list