Skip to content

Commit 6611889

Browse files
authored
Apply suggestions from code review
1 parent cf1d6b4 commit 6611889

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/test/test_uuid.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,13 +1093,14 @@ def test_uuid7_overflow_counter(self):
10931093

10941094
# Check that the timestamp of future UUIDs created within
10951095
# the same logical millisecond does not advance after the
1096-
# counter overflowed. In addition, since the counter could
1097-
# be incremented, we are no more in an "overflow" state.
1096+
# counter overflowed. In addition, even if the counter could
1097+
# be incremented, we are still in an "overflow" state as the
1098+
# timestamp should not be modified unless we re-overflow.
10981099
#
10991100
# See https://github.com/python/cpython/issues/138862.
11001101
v = self.uuid.uuid7()
11011102
equal(v.time, unix_ts_ms)
1102-
self.assertFalse(self.uuid._last_counter_v7_overflow)
1103+
self.assertTrue(self.uuid._last_counter_v7_overflow)
11031104

11041105
def test_uuid8(self):
11051106
equal = self.assertEqual

Lib/uuid.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,6 @@ def uuid7():
900900
timestamp_ms += 1
901901
counter, tail = _uuid7_get_counter_and_tail()
902902
else:
903-
_last_counter_v7_overflow = False
904903
# 32-bit random data
905904
tail = int.from_bytes(os.urandom(4))
906905

0 commit comments

Comments
 (0)