]> granicus.if.org Git - python/commitdiff
Fix py3k warnings in the uuid module
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 14 Oct 2009 19:09:48 +0000 (19:09 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 14 Oct 2009 19:09:48 +0000 (19:09 +0000)
Lib/uuid.py

index 4840fa5d0f31359af6c989b926bf3269f07b2358..6aaa2b475113039ddd9b63057deb40c736fa9d93 100644 (file)
@@ -489,8 +489,8 @@ def uuid1(node=None, clock_seq=None):
     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: