]> kaliko git repositories - python-musicpd.git/commitdiff
mpd.py: don't allow command_list_end if already iterating
authorJ. Alexander Treuman <jat@spatialrift.net>
Thu, 15 Jul 2010 21:27:23 +0000 (17:27 -0400)
committerJ. Alexander Treuman <jat@spatialrift.net>
Thu, 15 Jul 2010 21:27:23 +0000 (17:27 -0400)
mpd.py

diff --git a/mpd.py b/mpd.py
index c38204e7a111e99167f22cfdb1c637b833706a73..a850bb03da5c50fa1f6d8baa7fe51b23e117309c 100644 (file)
--- a/mpd.py
+++ b/mpd.py
@@ -418,6 +418,8 @@ class MPDClient(object):
     def command_list_end(self):
         if self._command_list is None:
             raise CommandListError("Not in command list")
+        if self._iterating:
+            raise IteratingError("Already iterating over a command list")
         self._write_command("command_list_end")
         return self._fetch_command_list()