ENH: do not sleep 1 sec only on older Pythons while testing filters

pull/280/head
Yaroslav Halchenko 2013-07-02 19:50:22 -04:00
parent 2ffc143597
commit 8c125b6053
1 changed files with 3 additions and 4 deletions

View File

@ -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