Skip to content

Commit ecc09ed

Browse files
committed
CONPY-321: Fixed index error in pool initialization
Fixed index error by iterating over connection array from behind. Kudos to G.Mech for reporting this issue and providing a fix.
1 parent 9dc46c2 commit ecc09ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mariadb/connectionpool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def __init__(self, *args, **kwargs):
112112
except mariadb.Error:
113113
# if an error occurred, close all connections
114114
# and raise exception
115-
for j in range(0, len(self._connections_free)):
115+
for j in reversed(range(0, len(self._connections_free))):
116116
try:
117117
self._connections_free[j].close()
118118
except mariadb.Error:

0 commit comments

Comments
 (0)