mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
ci: Fix websocket example test error handling
If connection fails for websocket test, a second exception was generated in __exit__
This commit is contained in:
parent
ea476f1731
commit
660f41772c
@ -37,6 +37,7 @@ class Websocket:
|
||||
self.socket.settimeout(10.0)
|
||||
self.send_q = queue.Queue()
|
||||
self.shutdown = Event()
|
||||
self.conn = None
|
||||
|
||||
def __enter__(self):
|
||||
try:
|
||||
@ -55,7 +56,8 @@ class Websocket:
|
||||
self.shutdown.set()
|
||||
self.server_thread.join()
|
||||
self.socket.close()
|
||||
self.conn.close()
|
||||
if self.conn:
|
||||
self.conn.close()
|
||||
|
||||
def run_server(self):
|
||||
self.conn, address = self.socket.accept() # accept new connection
|
||||
|
Loading…
Reference in New Issue
Block a user