From: J. Alexander Treuman Date: Thu, 15 Jul 2010 21:27:23 +0000 (-0400) Subject: mpd.py: don't allow command_list_end if already iterating X-Git-Tag: v0.3.0~21 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=9c09c839d9c9e8c9a0ac8a49655ef6a48eedf1cf;p=python-musicpd.git mpd.py: don't allow command_list_end if already iterating --- diff --git a/mpd.py b/mpd.py index c38204e..a850bb0 100644 --- 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()