Mercurial > cpython-lru_cache-weakref
diff Python/pytime.c @ 77415:0e46e0cd368f
PEP 418: Rename adjusted attribute to adjustable in time.get_clock_info() result
Fix also its value on Windows and Linux according to its documentation:
"adjustable" indicates if the clock *can be* adjusted, not if it is or was
adjusted.
In most cases, it is not possible to indicate if a clock is or was adjusted.
| author | Victor Stinner <victor.stinner@gmail.com> |
|---|---|
| date | Tue, 12 Jun 2012 22:46:37 +0200 |
| parents | bba131e48852 |
| children |
line wrap: on
line diff
--- a/Python/pytime.c Tue Jun 12 22:11:44 2012 +0200 +++ b/Python/pytime.c Tue Jun 12 22:46:37 2012 +0200 @@ -44,10 +44,7 @@ (void) GetSystemTimeAdjustment(&timeAdjustment, &timeIncrement, &isTimeAdjustmentDisabled); info->resolution = timeIncrement * 1e-7; - if (isTimeAdjustmentDisabled) - info->adjusted = 0; - else - info->adjusted = 1; + info->adjustable = 1; } #else /* There are three ways to get the time: @@ -71,7 +68,7 @@ info->implementation = "gettimeofday()"; info->resolution = 1e-6; info->monotonic = 0; - info->adjusted = 1; + info->adjustable = 1; } return; } @@ -87,7 +84,7 @@ info->implementation = "ftime()"; info->resolution = 1e-3; info->monotonic = 0; - info->adjusted = 1; + info->adjustable = 1; } } #else /* !HAVE_FTIME */ @@ -97,7 +94,7 @@ info->implementation = "time()"; info->resolution = 1.0; info->monotonic = 0; - info->adjusted = 1; + info->adjustable = 1; } #endif /* !HAVE_FTIME */
