]> kaliko git repositories - python-musicpd.git/commitdiff
mpd.py: set iterating flag before returning iterator
authorJ. Alexander Treuman <jat@spatialrift.net>
Thu, 15 Jul 2010 21:26:27 +0000 (17:26 -0400)
committerJ. Alexander Treuman <jat@spatialrift.net>
Thu, 15 Jul 2010 21:26:27 +0000 (17:26 -0400)
mpd.py

diff --git a/mpd.py b/mpd.py
index 8810face31f19cc2147815d71f286fca0c0f9c14..c38204e7a111e99167f22cfdb1c637b833706a73 100644 (file)
--- a/mpd.py
+++ b/mpd.py
@@ -275,7 +275,6 @@ class MPDClient(object):
         self._fetch_nothing()
 
     def _iterator_wrapper(self, iterator):
-        self._iterating = True
         for item in iterator:
             yield item
         self._iterating = False
@@ -283,6 +282,7 @@ class MPDClient(object):
     def _wrap_iterator(self, iterator):
         if not self.iterate:
             return list(iterator)
+        self._iterating = True
         return self._iterator_wrapper(iterator)
 
     def _fetch_nothing(self):