]> kaliko git repositories - python-musicpd.git/commitdiff
mpd.py: support commands with underscores
authorJ. Alexander Treuman <jat@spatialrift.net>
Mon, 13 Dec 2010 23:04:00 +0000 (18:04 -0500)
committerJ. Alexander Treuman <jat@spatialrift.net>
Mon, 13 Dec 2010 23:04:00 +0000 (18:04 -0500)
mpd.py

diff --git a/mpd.py b/mpd.py
index d40b5fab8791291db4e48b174fc97b29989533a8..5973a39b34c5580b3a885e67a232c76b5649d8fd 100644 (file)
--- 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):