Skip to content

Commit 4e7c63f

Browse files
Use methods that work with older versions of Python.
1 parent a4c13ab commit 4e7c63f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/oracledb/impl/thin/protocol.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -745,11 +745,11 @@ cdef class BaseAsyncProtocol(BaseProtocol):
745745
try:
746746
coroutine = self._process_message_helper(message)
747747
await asyncio.wait_for(coroutine, timeout_obj)
748-
except TimeoutError:
748+
except asyncio.TimeoutError:
749749
try:
750750
coroutine = self._process_timeout_helper(message, timeout)
751751
await asyncio.wait_for(coroutine, timeout_obj)
752-
except TimeoutError:
752+
except asyncio.TimeoutError:
753753
self._force_close()
754754
errors._raise_err(errors.ERR_CONNECTION_CLOSED,
755755
"socket timed out while recovering from " \
@@ -770,9 +770,9 @@ cdef class BaseAsyncProtocol(BaseProtocol):
770770
message.process(self._read_buf)
771771
if self._break_in_progress:
772772
try:
773-
async with asyncio.timeout(timeout_obj):
774-
await self._receive_packet(message)
775-
except TimeoutError:
773+
coroutine = self._receive_packet(message)
774+
await asyncio.wait_for(coroutine, timeout_obj)
775+
except asyncio.TimeoutError:
776776
self._force_close()
777777
errors._raise_err(errors.ERR_CONNECTION_CLOSED,
778778
"socket timed out while awaiting break " \

0 commit comments

Comments
 (0)