The previous commit only addressed errors raised during transferring
data, not the initial COPY statement.
:rtype: Copy
"""
- with self._conn.lock:
- self._conn.wait(self._start_copy_gen(statement, params))
-
try:
+ with self._conn.lock:
+ self._conn.wait(self._start_copy_gen(statement, params))
+
with Copy(self) as copy:
yield copy
except e.Error as ex:
"""
:rtype: AsyncCopy
"""
- async with self._conn.lock:
- await self._conn.wait(self._start_copy_gen(statement, params))
-
try:
+ async with self._conn.lock:
+ await self._conn.wait(self._start_copy_gen(statement, params))
+
async with AsyncCopy(self) as copy:
yield copy
except e.Error as ex: