You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
In get_connection, opt for if/else over superfluous try/except block #831
, we depend on a KeyError being raised from the pop operation on the idle pool, to branch into an alternative approach of forging a new connection.
If however KeyError were raised from other sources, due either to unforeseen problems with the code as-is or future developments of the Pool.get_connection method, this approach could go sideways, resulting in the new connection code being executed for potentially the wrong reasons.
if/else is more direct and less likely to fail.
See this PR to view the code changes being spoken of here.
changed the title [-]In `get_connection`, opt for if/else over superfluous try/except blocks[/-][+]In `get_connection`, opt for if/else over superfluous try/except block[/+]on Sep 3, 2026
Activity
[-]In `get_connection`, opt for if/else over superfluous try/except blocks[/-][+]In `get_connection`, opt for if/else over superfluous try/except block[/+][irods#831] Use if-else instead of try-except to avoid issues with Ke…
[#831] Use if-else instead of try-except to avoid issues with KeyError
korydraughn commentedon Oct 2, 2026
The work for this issue was completed by @glyg.
Closing.