From: J. Alexander Treuman Date: Thu, 15 Jul 2010 21:26:27 +0000 (-0400) Subject: mpd.py: set iterating flag before returning iterator X-Git-Tag: v0.3.0~22 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=6ab362fa29a1d5605f1540b83f13f47741272f32;p=python-musicpd.git mpd.py: set iterating flag before returning iterator --- diff --git a/mpd.py b/mpd.py index 8810fac..c38204e 100644 --- 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):