summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-09-02 22:13:46 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-09-02 22:13:46 (GMT)
commitc3c616c3d193c211bd435380593a20ec13e07b7b (patch)
treed71ab0c1bdb5c88362dc8e39e089a3add8f265f5 /Python
parent4912e7a3fd0c78d630b8e571d35c2968eb4b586c (diff)
downloadcpython-c3c616c3d193c211bd435380593a20ec13e07b7b.zip
cpython-c3c616c3d193c211bd435380593a20ec13e07b7b.tar.gz
cpython-c3c616c3d193c211bd435380593a20ec13e07b7b.tar.bz2
Issue #24707: Remove assertion in monotonic clock
Don't check anymore at runtime that the monotonic clock doesn't go backward. Yes, it happens. It occurs sometimes each month on a Debian buildbot slave running in a VM. The problem is that Python cannot do anything useful if a monotonic clock goes backward. It was decided in the PEP 418 to not fix the system, but only expose the clock provided by the OS.
Diffstat (limited to 'Python')
-rw-r--r--Python/pytime.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/Python/pytime.c b/Python/pytime.c
index 02a9374..e46bd42 100644
--- a/Python/pytime.c
+++ b/Python/pytime.c
@@ -533,10 +533,6 @@ _PyTime_GetSystemClockWithInfo(_PyTime_t *t, _Py_clock_info_t *info)
static int
pymonotonic_new(_PyTime_t *tp, _Py_clock_info_t *info, int raise)
{
-#ifdef Py_DEBUG
- static int last_set = 0;
- static _PyTime_t last = 0;
-#endif
#if defined(MS_WINDOWS)
ULONGLONG result;
@@ -628,12 +624,6 @@ pymonotonic_new(_PyTime_t *tp, _Py_clock_info_t *info, int raise)
if (_PyTime_FromTimespec(tp, &ts, raise) < 0)
return -1;
#endif
-#ifdef Py_DEBUG
- /* monotonic clock cannot go backward */
- assert(!last_set || last <= *tp);
- last = *tp;
- last_set = 1;
-#endif
return 0;
}