[Pkg-mpd-commits] [python-mpd] 64/262: mpd.py: clear command list if an exception is raised

Simon McVittie smcv at debian.org
Sun May 22 18:16:26 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 acefec82bb1b6dfd1230ecf8665a999f35aff300
Author: J. Alexander Treuman <jat at spatialrift.net>
Date:   Thu Jul 15 17:52:54 2010 -0400

    mpd.py: clear command list if an exception is raised
    
    This fixes a very longstanding bug where an MPD command error would raise
    an exception, but not clear the command list. This would prevent further
    commands from being executed until the command list was completed, which
    was impossible since the MPD command error broke out of the command list
    on the server side.
---
 mpd.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/mpd.py b/mpd.py
index 380f5b1..5e50295 100644
--- a/mpd.py
+++ b/mpd.py
@@ -269,9 +269,11 @@ class MPDClient(object):
             yield obj
 
     def _read_command_list(self):
-        for retval in self._command_list:
-            yield retval()
-        self._command_list = None
+        try:
+            for retval in self._command_list:
+                yield retval()
+        finally:
+            self._command_list = None
         self._fetch_nothing()
 
     def _iterator_wrapper(self, iterator):

-- 
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