diff tests/lib-stat.py @ 408:379050873141

PY3: Later PY3 versions do not have os.stat_float_times(): check whether it exists before using it
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 26 Jan 2020 15:25:52 +0100
parents 7ec353866f70
children
line wrap: on
line diff
--- a/tests/lib-stat.py	Sun Jan 26 14:38:30 2020 +0100
+++ b/tests/lib-stat.py	Sun Jan 26 15:25:52 2020 +0100
@@ -40,9 +40,10 @@
         self._do_reset = False
 
     def __enter__(self):
-        if not os.stat_float_times():
-            os.stat_float_times(True)
-            self._do_reset = True
+        if hasattr(os, "stat_float_times"):
+            if not os.stat_float_times():
+                os.stat_float_times(True)
+                self._do_reset = True
         return self
 
     def __exit__(self, *args):