[Pkg-mpd-commits] [python-mpd] 49/262: mpd.py: raise ConnectionError if unix sockets aren't supported

Simon McVittie smcv at debian.org
Sun May 22 18:16:23 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 52157b2b51dee943c994076fbd151ad539c1c0e5
Author: J. Alexander Treuman <jat at spatialrift.net>
Date:   Tue Jun 9 21:49:35 2009 -0400

    mpd.py: raise ConnectionError if unix sockets aren't supported
---
 mpd.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mpd.py b/mpd.py
index e2ef2e8..3050acd 100644
--- a/mpd.py
+++ b/mpd.py
@@ -299,6 +299,9 @@ class MPDClient(object):
         self._wfile = _NotConnected()
 
     def _unix_connect(self, path):
+        if not hasattr(socket, "AF_UNIX"):
+            raise ConnectionError("Unix domain sockets not supported "
+                                  "on this platform")
         sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
         sock.connect(path)
         return sock

-- 
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