ENH: fix of syntax for compatibility with Python 2.4

pull/8/head
Yaroslav Halchenko 2011-11-18 14:47:55 -05:00
parent bd658fc74b
commit eda7efbca3
1 changed files with 5 additions and 2 deletions

View File

@ -43,8 +43,11 @@ class FailData:
def setRetry(self, value):
self.__retry = value
# keep only the last matches or reset entirely
self.__matches = self.__matches[-min(len(self.__matches, value)):] \
if value else []
# Explicit if/else for compatibility with Python 2.4
if value:
self.__matches = self.__matches[-min(len(self.__matches, value)):]
else:
self.__matches = []
def getRetry(self):
return self.__retry