From 6ab362fa29a1d5605f1540b83f13f47741272f32 Mon Sep 17 00:00:00 2001 From: "J. Alexander Treuman" Date: Thu, 15 Jul 2010 17:26:27 -0400 Subject: [PATCH] mpd.py: set iterating flag before returning iterator --- mpd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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): -- 2.39.5