From b9cbc661d4b6865fed8c2482519c32f3c7029509 Mon Sep 17 00:00:00 2001 From: Fernando Date: Sun, 25 Jan 2015 01:17:17 -0200 Subject: [PATCH] Try to fix issue #258 SiCKRAGETV/sickrage-issues#258 related to: SiCKRAGETV/sickrage-issues#471 --- tornado/iostream.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tornado/iostream.py b/tornado/iostream.py index eced6d64..772aa4db 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -934,8 +934,9 @@ class IOStream(BaseIOStream): return self.socket def close_fd(self): - self.socket.close() - self.socket = None + if self.socket is not None: + self.socket.close() + self.socket = None def get_fd_error(self): errno = self.socket.getsockopt(socket.SOL_SOCKET,