Skip to content

Commit b26bf9e

Browse files
committed
Ensure that socket becomes closed when no more retries left
1 parent 7d50b47 commit b26bf9e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

couchdb/http.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,9 @@ def _try_request_with_retries(retries):
319319
except StopIteration:
320320
# No more retries, raise last socket error.
321321
raise e
322-
time.sleep(delay)
323-
conn.close()
322+
finally:
323+
time.sleep(delay)
324+
conn.close()
324325

325326
def _try_request():
326327
try:

0 commit comments

Comments
 (0)