summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-07-20 15:13:16 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-07-20 15:13:16 (GMT)
commit3d0b8422bcbed2c06394ac7dfc9e7cbfe910b220 (patch)
treef567b6437f8153363b846d01319f54d00669ea75 /Lib
parent043e8008603b168812bb6973f870fdd2132304b7 (diff)
parentc0b1e0f868a8688b49399ec83c05bc318bb90916 (diff)
downloadcpython-3d0b8422bcbed2c06394ac7dfc9e7cbfe910b220.zip
cpython-3d0b8422bcbed2c06394ac7dfc9e7cbfe910b220.tar.gz
cpython-3d0b8422bcbed2c06394ac7dfc9e7cbfe910b220.tar.bz2
Merge 3.4
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_os.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 6581e35..2e23615 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -430,12 +430,18 @@ class UtimeTests(unittest.TestCase):
with open(self.fname, 'wb') as fp:
fp.write(b"ABC")
+ def restore_float_times(state):
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore", DeprecationWarning)
+
+ os.stat_float_times(state)
+
# ensure that st_atime and st_mtime are float
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
- old_state = os.stat_float_times(-1)
- self.addCleanup(os.stat_float_times, old_state)
+ old_float_times = os.stat_float_times(-1)
+ self.addCleanup(restore_float_times, old_float_times)
os.stat_float_times(True)