Skip to content

Commit e2323c0

Browse files
Avoid exception due to timing issue on interpreter shutdown.
1 parent d66fba8 commit e2323c0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/oracledb/impl/thin/pool.pyx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -429,12 +429,13 @@ cdef class BaseThinPoolImpl(BasePoolImpl):
429429
"""
430430
cdef Protocol protocol = <Protocol> conn_impl._protocol
431431
with self._condition:
432-
try:
433-
protocol._end_request(conn_impl)
434-
except:
435-
if not in_del:
436-
raise
437-
self._return_connection_helper(conn_impl)
432+
if self._open:
433+
try:
434+
protocol._end_request(conn_impl)
435+
except:
436+
if not in_del:
437+
raise
438+
self._return_connection_helper(conn_impl)
438439

439440
def set_getmode(self, uint32_t value):
440441
"""

0 commit comments

Comments
 (0)