mirror of
https://github.com/fail2ban/fail2ban.git
synced 2026-03-11 08:55:31 +00:00
ENH: fix of syntax for compatibility with Python 2.4
This commit is contained in:
parent
bd658fc74b
commit
eda7efbca3
1 changed files with 5 additions and 2 deletions
|
|
@ -43,8 +43,11 @@ class FailData:
|
||||||
def setRetry(self, value):
|
def setRetry(self, value):
|
||||||
self.__retry = value
|
self.__retry = value
|
||||||
# keep only the last matches or reset entirely
|
# keep only the last matches or reset entirely
|
||||||
self.__matches = self.__matches[-min(len(self.__matches, value)):] \
|
# Explicit if/else for compatibility with Python 2.4
|
||||||
if value else []
|
if value:
|
||||||
|
self.__matches = self.__matches[-min(len(self.__matches, value)):]
|
||||||
|
else:
|
||||||
|
self.__matches = []
|
||||||
|
|
||||||
def getRetry(self):
|
def getRetry(self):
|
||||||
return self.__retry
|
return self.__retry
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue