bpo-31827: Remove os.stat_float_times() (GH-4061)

This commit is contained in:
Victor Stinner 2017-10-24 02:02:00 -07:00 committed by GitHub
parent 87d332dcdb
commit 01b5aab7bf
7 changed files with 13 additions and 99 deletions

View file

@ -81,12 +81,6 @@ else:
HAVE_WHEEL_GROUP = sys.platform.startswith('freebsd') and os.getgid() == 0
@contextlib.contextmanager
def ignore_deprecation_warnings(msg_regex, quiet=False):
with support.check_warnings((msg_regex, DeprecationWarning), quiet=quiet):
yield
def requires_os_func(name):
return unittest.skipUnless(hasattr(os, name), 'requires os.%s' % name)
@ -488,17 +482,6 @@ class UtimeTests(unittest.TestCase):
os.mkdir(self.dirname)
create_file(self.fname)
def restore_float_times(state):
with ignore_deprecation_warnings('stat_float_times'):
os.stat_float_times(state)
# ensure that st_atime and st_mtime are float
with ignore_deprecation_warnings('stat_float_times'):
old_float_times = os.stat_float_times(-1)
self.addCleanup(restore_float_times, old_float_times)
os.stat_float_times(True)
def support_subsecond(self, filename):
# Heuristic to check if the filesystem supports timestamp with
# subsecond resolution: check if float and int timestamps are different