Skip to content

Commit 4406796

Browse files
committed
import time globally as UUIDv7 is likely to be used now
1 parent a756b9d commit 4406796

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Lib/uuid.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454

5555
import os
5656
import sys
57+
import time
5758

5859
from enum import Enum, _simple_enum
5960

@@ -707,7 +708,6 @@ def uuid1(node=None, clock_seq=None):
707708
return UUID(bytes=uuid_time, is_safe=is_safe)
708709

709710
global _last_timestamp
710-
import time
711711
nanoseconds = time.time_ns()
712712
# 0x01b21dd213814000 is the number of 100-ns intervals between the
713713
# UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00.
@@ -789,7 +789,6 @@ def uuid7():
789789
global _last_timestamp_v7
790790
global _last_counter_v7
791791

792-
import time
793792
nanoseconds = time.time_ns()
794793
timestamp_ms = nanoseconds // 1_000_000
795794

0 commit comments

Comments
 (0)