X-Git-Url: http://git.kaliko.me/?p=python-musicpd.git;a=blobdiff_plain;f=mpd.py;h=384f856f522d44214c444179c2f5ba586d48e4f2;hp=5acc575e8794c661dfe36bcd18274d166f511e7b;hb=74eff57815a3308a1fafd14c1ebbcdb8714bec75;hpb=7a8cd2d87ad2588c3cae11fe05fb9009460675fb diff --git a/mpd.py b/mpd.py index 5acc575..384f856 100644 --- a/mpd.py +++ b/mpd.py @@ -291,9 +291,13 @@ class MPDClient(object): if self._sock: raise ConnectionError("Already connected") msg = "getaddrinfo returns an empty list" + try: + flags = socket.AI_ADDRCONFIG + except AttributeError: + flags = 0 for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM, socket.IPPROTO_TCP, - socket.AI_ADDRCONFIG): + flags): af, socktype, proto, canonname, sa = res try: self._sock = socket.socket(af, socktype, proto)