Skip to content

Commit

Permalink
Close the socket outside the while loop (#359)
Browse files Browse the repository at this point in the history
* Close the socket outside the while loop

* Solve conflicts
  • Loading branch information
felipediel authored May 7, 2020
1 parent 3216b06 commit 934bf7a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions broadlink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ def send_packet(self, command, payload):
break
except socket.timeout:
if (time.time() - start_time) > self.timeout:
cs.close()
raise exception(0xfffd)
finally:
cs.close()
cs.close()
return bytearray(response[0])


Expand Down

0 comments on commit 934bf7a

Please sign in to comment.