From 756f8629e87886799fbbb7467ce022613cf56ac9 Mon Sep 17 00:00:00 2001 From: "J. Alexander Treuman" Date: Mon, 13 Dec 2010 18:04:00 -0500 Subject: [PATCH] mpd.py: support commands with underscores --- mpd.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mpd.py b/mpd.py index d40b5fa..5973a39 100644 --- a/mpd.py +++ b/mpd.py @@ -157,10 +157,11 @@ class MPDClient(object): else: command = attr wrapper = self._execute - command = command.replace("_", " ") if command not in self._commands: - raise AttributeError("'%s' object has no attribute '%s'" % - (self.__class__.__name__, attr)) + command = command.replace("_", " ") + if command not in self._commands: + raise AttributeError("'%s' object has no attribute '%s'" % + (self.__class__.__name__, attr)) return lambda *args: wrapper(command, args) def _send(self, command, args): -- 2.39.5