Permalink
Browse files

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.
  • Loading branch information...
1 parent a55e3f1 commit acefec82bb1b6dfd1230ecf8665a999f35aff300 J. Alexander Treuman committed Jul 15, 2010
Showing with 5 additions and 3 deletions.
  1. +5 −3 mpd.py
View
8 mpd.py
@@ -269,9 +269,11 @@ def _read_objects(self, delimiters=[]):
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):

0 comments on commit acefec8

Please sign in to comment.