[Pkg-mpd-commits] [python-mpd] 35/262: mpd.py: reset to disconnected state if _hello() fails in connect()

Simon McVittie smcv at debian.org
Sun May 22 18:16:22 UTC 2016


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch upstream
in repository python-mpd.

commit 202767471f017c54d1ba73e2ad4bedca5ef0d40f
Author: J. Alexander Treuman <jat at spatialrift.net>
Date:   Sun Mar 23 17:07:55 2008 -0400

    mpd.py: reset to disconnected state if _hello() fails in connect()
---
 mpd.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/mpd.py b/mpd.py
index ae1f2b3..bd68b3c 100644
--- a/mpd.py
+++ b/mpd.py
@@ -307,7 +307,11 @@ class MPDClient(object):
             raise socket.error, msg
         self._rfile = self._sock.makefile("rb")
         self._wfile = self._sock.makefile("wb")
-        self._hello()
+        try:
+            self._hello()
+        except (socket.error, MPDError):
+            self.disconnect()
+            raise
 
     def disconnect(self):
         self._rfile.close()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mpd/python-mpd.git



More information about the Pkg-mpd-commits mailing list