mirror of https://github.com/fail2ban/fail2ban
ENH: do not sleep 1 sec only on older Pythons while testing filters
parent
2ffc143597
commit
8c125b6053
|
@ -109,10 +109,9 @@ def _copy_lines_between_files(fin, fout, n=None, skip=0, mode='a', terminal_line
|
||||||
|
|
||||||
Returns open fout
|
Returns open fout
|
||||||
"""
|
"""
|
||||||
if sys.version_info[:2] <= (2,4): # pragma: no cover
|
# on older Pythons and on some FSs st_mtime is int, so we should
|
||||||
# on old Python st_mtime is int, so we should give at least 1 sec so
|
# give it some time so polling filter could detect the change
|
||||||
# polling filter could detect the change
|
mtimesleep()
|
||||||
time.sleep(1)
|
|
||||||
if isinstance(fin, str): # pragma: no branch - only used with str in test cases
|
if isinstance(fin, str): # pragma: no branch - only used with str in test cases
|
||||||
fin = open(fin, 'r')
|
fin = open(fin, 'r')
|
||||||
# Skip
|
# Skip
|
||||||
|
|
Loading…
Reference in New Issue