From af6e84c66350a7e833cfc0c0fb3d0d5678777e21 Mon Sep 17 00:00:00 2001 From: "J. Alexander Treuman" Date: Sun, 28 Nov 2010 21:17:24 -0500 Subject: [PATCH] mpd.py: always compare self._sock to None --- mpd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() -- 2.39.2