]> kaliko git repositories - python-musicpd.git/commitdiff
mpd.py: always compare self._sock to None
authorJ. Alexander Treuman <jat@spatialrift.net>
Mon, 29 Nov 2010 02:17:24 +0000 (21:17 -0500)
committerJ. Alexander Treuman <jat@spatialrift.net>
Mon, 29 Nov 2010 02:17:24 +0000 (21:17 -0500)
mpd.py

diff --git a/mpd.py b/mpd.py
index b87891b8b93e9be559d26ac39c85f44c4ac56888..846e3e4ad363eaeee4b0d76f2f26f23f20e110ea 100644 (file)
--- a/mpd.py
+++ b/mpd.py
@@ -383,7 +383,7 @@ class MPDClient(object):
             raise ConnectionError("getaddrinfo returns an empty list")
 
     def connect(self, host, port):
-        if self._sock:
+        if self._sock is not None:
             raise ConnectionError("Already connected")
         if host.startswith("/"):
             self._sock = self._connect_unix(host)
@@ -404,7 +404,7 @@ class MPDClient(object):
         self._reset()
 
     def fileno(self):
-        if not self._sock:
+        if self._sock is None:
             raise ConnectionError("Not connected")
         return self._sock.fileno()