From: J. Alexander Treuman Date: Mon, 13 Dec 2010 23:04:00 +0000 (-0500) Subject: mpd.py: support commands with underscores X-Git-Tag: v0.3.0~6 X-Git-Url: http://git.kaliko.me/?p=python-musicpd.git;a=commitdiff_plain;h=756f8629e87886799fbbb7467ce022613cf56ac9 mpd.py: support commands with underscores --- 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):