From 94fd67b7f97142bda274187e463320834a58cc15 Mon Sep 17 00:00:00 2001 From: "J. Alexander Treuman" Date: Sat, 1 Mar 2008 15:03:47 -0500 Subject: [PATCH] mpd.py: making _getitem return None if no item is returned update and addid should normally always return a single item, so previously an exception was raised if we got nothing. However, when used in a command_list, only the *last* call to update will return an item. So return None instead of raising an exception if we get nothing. --- mpd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpd.py b/mpd.py index a5e1877..be8b390 100644 --- a/mpd.py +++ b/mpd.py @@ -225,7 +225,7 @@ class MPDClient(object): def _getitem(self): items = list(self._readitems()) if len(items) != 1: - raise ProtocolError, "Expected 1 item, got %i" % len(items) + return return items[0][1] def _getlist(self): -- 2.39.5