1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-08 16:53:23 +00:00

fix a KeyError

This commit is contained in:
Thomas Grainger
2023-12-15 11:07:56 +00:00
parent 556fd0166c
commit fa789e975b

View File

@@ -386,7 +386,10 @@ class ConnectionRemover:
while pool.pool and not pool.pool.empty() and connections:
connection = pool.pool.get()
if isinstance(connection, self._connection_class):
connections.remove(connection)
try:
connections.remove(connection)
except KeyError:
pass
connection.close()
else:
readd_connections.append(connection)