[Pkg-mpd-commits] [python-mpd] 77/262: mpd.py: support commands with underscores

Simon McVittie smcv at debian.org
Sun May 22 18:16:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch upstream
in repository python-mpd.

commit 756f8629e87886799fbbb7467ce022613cf56ac9
Author: J. Alexander Treuman <jat at spatialrift.net>
Date:   Mon Dec 13 18:04:00 2010 -0500

    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):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mpd/python-mpd.git



More information about the Pkg-mpd-commits mailing list