From: J. Alexander Treuman Date: Mon, 29 Nov 2010 02:17:24 +0000 (-0500) Subject: mpd.py: always compare self._sock to None X-Git-Tag: v0.3.0~15 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=af6e84c66350a7e833cfc0c0fb3d0d5678777e21;p=python-musicpd.git mpd.py: always compare self._sock to None --- diff --git a/mpd.py b/mpd.py index b87891b..846e3e4 100644 --- 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()