[Pkg-mpd-commits] [python-mpd] 63/262: mpd.py: unset iterating flag if an exception is raised

Simon McVittie smcv at debian.org
Sun May 22 18:16:25 UTC 2016


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch upstream
in repository python-mpd.

commit a55e3f15d6d53355acae2d809e1a5c512115b0dc
Author: J. Alexander Treuman <jat at spatialrift.net>
Date:   Thu Jul 15 17:49:53 2010 -0400

    mpd.py: unset iterating flag if an exception is raised
    
    This fixes a bug where an MPD command error would raise an exception, but
    leave the iterating flag set, preventing further commands from being
    executed.
---
 mpd.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/mpd.py b/mpd.py
index a850bb0..380f5b1 100644
--- a/mpd.py
+++ b/mpd.py
@@ -275,9 +275,11 @@ class MPDClient(object):
         self._fetch_nothing()
 
     def _iterator_wrapper(self, iterator):
-        for item in iterator:
-            yield item
-        self._iterating = False
+        try:
+            for item in iterator:
+                yield item
+        finally:
+            self._iterating = False
 
     def _wrap_iterator(self, iterator):
         if not self.iterate:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mpd/python-mpd.git



More information about the Pkg-mpd-commits mailing list