From: J. Alexander Treuman Date: Sun, 23 Mar 2008 20:01:31 +0000 (-0400) Subject: mpd.py: raise ConnectionError if connect() is called when already connected X-Git-Tag: v0.2.0~10 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=4f4b01dd0d04a341f6834fdca4d777ff5d6850db;p=python-musicpd.git mpd.py: raise ConnectionError if connect() is called when already connected --- 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")