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 33449ca..ce1784b 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")