Skip to content

Commit

Permalink
Must not double close.
Browse files Browse the repository at this point in the history
  • Loading branch information
quantum5 committed Dec 3, 2017
1 parent a2b2938 commit 07c871a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dmoj/packet.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ def _do_reconnect(self):
self._reconnect()

def __del__(self):
if not self._closed:
self.close()
self.close()

def close(self):
if self.conn:
if self.conn and not self._closed:
self.conn.shutdown(socket.SHUT_RDWR)
self._closed = True

def _read_async(self):
try:
Expand Down

0 comments on commit 07c871a

Please sign in to comment.