From 8c125b6053d137132bacfa7c25cb84e261cd9894 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 2 Jul 2013 19:50:22 -0400 Subject: [PATCH] ENH: do not sleep 1 sec only on older Pythons while testing filters --- testcases/filtertestcase.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/testcases/filtertestcase.py b/testcases/filtertestcase.py index 2381c942..f2f6eb50 100644 --- a/testcases/filtertestcase.py +++ b/testcases/filtertestcase.py @@ -109,10 +109,9 @@ def _copy_lines_between_files(fin, fout, n=None, skip=0, mode='a', terminal_line Returns open fout """ - if sys.version_info[:2] <= (2,4): # pragma: no cover - # on old Python st_mtime is int, so we should give at least 1 sec so - # polling filter could detect the change - time.sleep(1) + # on older Pythons and on some FSs st_mtime is int, so we should + # give it some time so polling filter could detect the change + mtimesleep() if isinstance(fin, str): # pragma: no branch - only used with str in test cases fin = open(fin, 'r') # Skip