[Pkg-mpd-commits] [python-mpd] 250/262: Allow to call the method disconnect, same when any connection is alive

Simon McVittie smcv at debian.org
Sun May 22 18:16:54 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 963aa593166ba1f72da1a154923dedb5f447e495
Author: Babacar Tall <babacar.tall at gmail.com>
Date:   Wed Oct 14 20:03:10 2015 +0200

    Allow to call the method disconnect, same when any connection is alive
---
 mpd.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mpd.py b/mpd.py
index 313c4a9..d9e7a81 100644
--- a/mpd.py
+++ b/mpd.py
@@ -532,9 +532,11 @@ class MPDClient(object):
 
     def disconnect(self):
         logger.info("Calling MPD disconnect()")
-        if self._rfile is not None:
+        if (self._rfile is not None
+                and not isinstance(self._rfile, _NotConnected)):
             self._rfile.close()
-        if self._wfile is not None:
+        if (self._wfile is not None
+                and not isinstance(self._wfile, _NotConnected)):
             self._wfile.close()
         if self._sock is not None:
             self._sock.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