Skip to content

Commit cd7262e

Browse files
authored
fix: Catch all response.shutdown exceptions (#45)
The response shutdown might trigger an exception for a number of reasons from within the urllib3 library. Since this is a shutdown procedure, and there isn't a way to recover at that point, we are going to simply catch all possible exceptions and continue to shutdown as gracefully as possible.
1 parent b8e7853 commit cd7262e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ld_eventsource/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def connect(self, last_event_id: Optional[str]) -> Tuple[Iterator[bytes], Callab
9191
def close():
9292
try:
9393
resp.shutdown()
94-
except AttributeError:
94+
except Exception:
9595
pass
9696
resp.release_conn()
9797

0 commit comments

Comments
 (0)