]> kaliko git repositories - python-musicpd.git/commitdiff
mpd.py: strip trailing \n from MPD's hello line for a nicer error message
authorJ. Alexander Treuman <jat@spatialrift.net>
Sun, 23 Mar 2008 21:10:41 +0000 (17:10 -0400)
committerJ. Alexander Treuman <jat@spatialrift.net>
Sun, 23 Mar 2008 21:10:41 +0000 (17:10 -0400)
mpd.py

diff --git a/mpd.py b/mpd.py
index bd68b3cf4c4cd26d7088014de89b1509535fa7ef..c924b3c758940ba4a1d4d43014339dc34e92cce7 100644 (file)
--- a/mpd.py
+++ b/mpd.py
@@ -275,6 +275,7 @@ class MPDClient(object):
         line = self._rfile.readline()
         if not line.endswith("\n"):
             raise ConnectionError, "Connection lost while reading MPD hello"
+        line = line.rstrip("\n")
         if not line.startswith(HELLO_PREFIX):
             raise ProtocolError, "Got invalid MPD hello: '%s'" % line
         self.mpd_version = line[len(HELLO_PREFIX):].strip()