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.
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index 02f05c3..bd72af5 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -32,14 +32,14 @@
info = time.get_clock_info('time')
self.assertFalse(info.monotonic)
if sys.platform != 'win32':
- self.assertTrue(info.adjusted)
+ self.assertTrue(info.adjustable)
def test_clock(self):
time.clock()
info = time.get_clock_info('clock')
self.assertTrue(info.monotonic)
- self.assertFalse(info.adjusted)
+ self.assertFalse(info.adjustable)
@unittest.skipUnless(hasattr(time, 'clock_gettime'),
'need time.clock_gettime()')
@@ -372,9 +372,9 @@
info = time.get_clock_info('monotonic')
self.assertTrue(info.monotonic)
if sys.platform == 'linux':
- self.assertTrue(info.adjusted)
+ self.assertTrue(info.adjustable)
else:
- self.assertFalse(info.adjusted)
+ self.assertFalse(info.adjustable)
def test_perf_counter(self):
time.perf_counter()
@@ -390,7 +390,7 @@
info = time.get_clock_info('process_time')
self.assertTrue(info.monotonic)
- self.assertFalse(info.adjusted)
+ self.assertFalse(info.adjustable)
@unittest.skipUnless(hasattr(time, 'monotonic'),
'need time.monotonic')
@@ -441,7 +441,7 @@
# 0.0 < resolution <= 1.0
self.assertGreater(info.resolution, 0.0)
self.assertLessEqual(info.resolution, 1.0)
- self.assertIsInstance(info.adjusted, bool)
+ self.assertIsInstance(info.adjustable, bool)
self.assertRaises(ValueError, time.get_clock_info, 'xxx')