From: Victor Stinner Date: Thu, 15 Mar 2012 00:22:16 +0000 (+0100) Subject: Issue #14222: Use the new time.steady() function instead of time.time() for X-Git-Tag: v3.3.0a2~182 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d7c878fe370e59b142bac9bc32c67b4ac9d949e;p=python 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. --- diff --git a/Lib/queue.py b/Lib/queue.py index ba608c5a4c..1dc72c4bbe 100644 --- a/Lib/queue.py +++ b/Lib/queue.py @@ -6,7 +6,7 @@ except ImportError: import dummy_threading as threading from collections import deque from heapq import heappush, heappop -from time import time +from time import steady as time __all__ = ['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue'] diff --git a/Lib/threading.py b/Lib/threading.py index 441c7bd903..197dec4fb1 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -3,7 +3,7 @@ import sys as _sys import _thread -from time import time as _time, sleep as _sleep +from time import steady as _time, sleep as _sleep from traceback import format_exc as _format_exc from _weakrefset import WeakSet diff --git a/Misc/NEWS b/Misc/NEWS index 6937a45b51..cb1ec6ddd4 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -24,6 +24,10 @@ Core and Builtins Library ------- +- 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. + - Issue #13248: Remove lib2to3.pytree.Base.get_prefix/set_prefix. - Issue #14234: CVE-2012-0876: Randomize hashes of xml attributes in the hash