RF: filter.py -- single readline in a loop

pull/8/merge
Yaroslav Halchenko 2012-07-19 01:10:59 -04:00
parent b3614d4ea2
commit 25674a95f8
1 changed files with 4 additions and 6 deletions

View File

@ -455,14 +455,12 @@ class FileFilter(Filter):
logSys.exception(e)
return False
line = container.readline()
while not line == "":
if not self._isActive():
# The jail has been stopped
while True:
line = container.readline()
if (line == "") or not self._isActive():
# The jail reached the bottom or has been stopped
break
self.processLineAndAdd(line)
# Read a new line.
line = container.readline()
container.close()
return True