From 4f4b01dd0d04a341f6834fdca4d777ff5d6850db Mon Sep 17 00:00:00 2001 From: "J. Alexander Treuman" Date: Sun, 23 Mar 2008 16:01:31 -0400 Subject: [PATCH] mpd.py: raise ConnectionError if connect() is called when already connected --- mpd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mpd.py b/mpd.py index 33449ca..ce1784b 100644 --- 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") -- 2.39.5