Skip to content

Commit 1608eaf

Browse files
committed
fix(cursor, execute): log underlying connection state using class variables when exception is raised. resolves db-api extension warnings #204
1 parent 0da4744 commit 1608eaf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

redshift_connector/cursor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ def execute(self: "Cursor", operation, args=None, stream=None, merge_socket_read
241241
self._c.execute(self, operation, args)
242242
except Exception as e:
243243
try:
244-
_logger.debug("Cursor's connection._usock state: %s", self.connection._usock.__dict__) # type: ignore
245-
_logger.debug("Cursor's connection._sock is closed: %s", self.connection._sock.closed) # type: ignore
244+
_logger.debug("Cursor's connection._usock state: %s", str(self._c._usock.__dict__))
245+
_logger.debug("Cursor's connection._sock is closed: %s", str(self._c._sock.closed))
246246
except:
247247
pass
248248
raise e

0 commit comments

Comments
 (0)