import with_statement

This commit is contained in:
Romain Bignon 2010-06-09 12:09:18 +02:00
commit 70c10e69a9
2 changed files with 11 additions and 3 deletions

View file

@ -15,6 +15,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
from __future__ import with_statement
from logging import warning
from weboob.backend import BaseBackend
@ -60,7 +62,9 @@ class FourChanBackend(BaseBackend, ICapMessages):
for message in self._iter_thread_messages(board, thread_wanted, only_new):
yield message
else:
for thread in self.browser.get_threads(board):
with self.browser:
threads = self.browser.get_threads(board)
for thread in threads:
for message in self._iter_thread_messages(board, thread.id, only_new):
yield message