Skip to content

Commit 3d7c878

Browse files
committed
Issue #14222: Use the new time.steady() function instead of time.time() for
timeout in queue and threading modules to not be affected of system time update.
1 parent 071eca3 commit 3d7c878

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

Lib/queue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import dummy_threading as threading
77
from collections import deque
88
from heapq import heappush, heappop
9-
from time import time
9+
from time import steady as time
1010

1111
__all__ = ['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue']
1212

Lib/threading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys as _sys
44
import _thread
55

6-
from time import time as _time, sleep as _sleep
6+
from time import steady as _time, sleep as _sleep
77
from traceback import format_exc as _format_exc
88
from _weakrefset import WeakSet
99

Misc/NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ Core and Builtins
2424
Library
2525
-------
2626

27+
- Issue #14222: Use the new time.steady() function instead of time.time() for
28+
timeout in queue and threading modules to not be affected of system time
29+
update.
30+
2731
- Issue #13248: Remove lib2to3.pytree.Base.get_prefix/set_prefix.
2832

2933
- Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes in the hash

0 commit comments

Comments
 (0)