]> kaliko git repositories - python-musicpd.git/commitdiff
mpd.py: raise ConnectionError if connect() is called when already connected
authorJ. Alexander Treuman <jat@spatialrift.net>
Sun, 23 Mar 2008 20:01:31 +0000 (16:01 -0400)
committerJ. Alexander Treuman <jat@spatialrift.net>
Sun, 23 Mar 2008 20:01:31 +0000 (16:01 -0400)
mpd.py

diff --git a/mpd.py b/mpd.py
index 33449ca5aabbe8abb3f974354bebabe48f8a44fb..ce1784b4227da5aa437801ef2d536b91d8cb4851 100644 (file)
--- a/mpd.py
+++ b/mpd.py
@@ -288,7 +288,7 @@ class MPDClient(object):
 
     def connect(self, host, port):
         if self._sock:
-            self.disconnect()
+            raise ConnectionError, "Already connected"
         self._sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
         self._sock.connect((host, port))
         self._rfile = self._sock.makefile("rb")