]> kaliko git repositories - python-musicpd.git/commitdiff
python3 conversion
authorkaliko <efrim@azylum.org>
Thu, 4 Oct 2012 15:28:45 +0000 (17:28 +0200)
committerkaliko <efrim@azylum.org>
Thu, 4 Oct 2012 15:28:45 +0000 (17:28 +0200)
Only supports python >= 3.2

mpd.py

diff --git a/mpd.py b/mpd.py
index 7305f7d94eba202796d147894c9ecb671cc1381a..674f71451cf18af4677d01df3da5a0a859f4aea6 100644 (file)
--- a/mpd.py
+++ b/mpd.py
@@ -396,7 +396,8 @@ class MPDClient(object):
                 sock = socket.socket(af, socktype, proto)
                 sock.connect(sa)
                 return sock
-            except socket.error, err:
+            except socket.error as socket_err:
+                err = socket_err
                 if sock is not None:
                     sock.close()
         if err is not None:
@@ -411,8 +412,8 @@ class MPDClient(object):
             self._sock = self._connect_unix(host)
         else:
             self._sock = self._connect_tcp(host, port)
-        self._rfile = self._sock.makefile("rb")
-        self._wfile = self._sock.makefile("wb")
+        self._rfile = self._sock.makefile("r")
+        self._wfile = self._sock.makefile("w")
         try:
             self._hello()
         except: